reordering atomic operations in C++
问题 Suppose I have 2 threads: int value = 0; std::atomic<bool> ready = false; thread 1: value = 1 ready = true; thread 2: while (!ready); std::cout << value; Is this program able to output 0? I read about the C++ memory model - specifically, sequential consistency, which I believe is the default, and it wasn't particularly clear. Is the compiler only required to put atomic operations in the correct order relative to each other, or is it required to put atomic operations in the right order