C++ not Turing Complete?
C++ not Turing Complete?
Posted Dec 11, 2022 19:40 UTC (Sun) by Wol (subscriber, #4433)In reply to: C++ not Turing Complete? by gmatht
Parent article: Rust support coming to GCC
Loop, wait for an event, handle or pass off, repeat.
The whole point of it is you're meant to loop indefinitely ...
Cheers,
Wol
Posted Dec 11, 2022 20:10 UTC (Sun)
by ABCD (subscriber, #53650)
[Link]
So long as you make "forward progress" inside that loop, you are fine. The problems only arise if you don't do one of the following: I would presume that in your event handler, you are going to wait for an event somehow, which would require that you either call a library I/O function to see if you have events (and/or get the event information), access a volatile glvalue (in the case of a hardware event handler with memory-mapped I/O, for instance), or perform a synchronization operation or atomic operation (which is probably needed for thread safety if the events are being posted by another thread in the same application). In any of these cases, you have made forward progress in some manner, using the standard's definition of "forward progress".
C++ not Turing Complete?