1
General Discussion about just::thread / sequential consistency for std::atomic on x86
« on: December 05, 2009, 08:11:52 AM »
Hello,
I was just reading slides from a talk that are available here:
http://www.nwcpp.org/Downloads/2008/Memory_Fences.pdf
On page 16, this person asserts that on x86, the memory model enables the relaxed std::atomic conditions shown on that slide to be implemented as nothing, so there would be no performance penalty for that code (assuming the atomic types had atomic store instructions), only that the compiler be required not to reverse the orders.
My questions:
1. Is this person correct?
2. Would your library for Visual Studio indeed implement as no-ops?
3. How does your library force the compiler not to reorder the stores?
Thanks
I was just reading slides from a talk that are available here:
http://www.nwcpp.org/Downloads/2008/Memory_Fences.pdf
On page 16, this person asserts that on x86, the memory model enables the relaxed std::atomic conditions shown on that slide to be implemented as nothing, so there would be no performance penalty for that code (assuming the atomic types had atomic store instructions), only that the compiler be required not to reverse the orders.
My questions:
1. Is this person correct?
2. Would your library for Visual Studio indeed implement as no-ops?
3. How does your library force the compiler not to reorder the stores?
Thanks