Linked Questions

Popular Questions

How to iterate over all possible executions of a program?

The C++ standard says that the behavior of a program is undefined if at least one of all possible executions of this program has a data race.

How does one get (or iterate over) all possible executions of a program for a given input?
Is there an algorithm to do this?

Right now this task seems very complicated to me.
The main problem is that a read in one thread might return a future write to this variable from another thread.
But at the time we evaluate the read, we don't know what writes will happen in another threads in the future.
More than that, what future writes will happen in other threads may depend on the value returned by this read.

Related Questions