I know in Java visibility of a member is not guaranteed when accessing it from another thread.
The meaning is the accessing thread will maybe see a stole value of the member (becuase the cache has not been flushed to main memory yet).
I wonder if that is the case for C++ too? (also in C++11?)
If so, how do you solve this problem in C++? (In Java, you can use the synchronized keyword).