On Wed, Dec 25, 2013 at 5:12 PM, Rob Stewart
On Dec 25, 2013, at 7:47 AM, Andrey Semashev
wrote: On Wed, Dec 25, 2013 at 4:40 PM, Rob Stewart
wrote: On Dec 24, 2013, at 2:24 PM, Andrey Semashev
wrote: So does this mean that Boost.Atomic is perhaps not safe after all?
No, it's perfectly safe on x86. It is also safe on ARM if /volatile:ms is specified.
How do you ensure the use of /volatile:ms? Can users build Boost with /volatile:iso?
You can't, I was just answering John's question.
You used the phrase, "perfectly safe," which suggested that /volatile:ms was somehow ensured on x86.
x86 guarantees correct memory view, except for very specific operations. And compiler barriers in the code guarantee that the actual instructions are generated in the right order. So yes, regardless of the /volatile:ms switch, on x86 it works as intended.