
Gottlob Frege wrote:
On Thu, Aug 25, 2011 at 12:13 AM, Stephan T. Lavavej <stl@exchange.microsoft.com> wrote:
[Gottlob Frege]
1. I wish that C++11 atomics defaulted to acquire-on-read and release-on-write, and that's how I will almost always use them. It is also what java and C# use, I believe (on volatiles).
That doesn't solve the "independent reads, independent writes" problem, which is why the non-Standard semantics that VC8 gave volatile aren't really useful. (volatile: a multithreaded programmer's worst enemy.)
What's the "independent reads, independent writes" problem? I've probably heard, seen, or mistakenly had a bug due to it once, but don't know it by name.
The Standard's focus on sequential consistency by default was carefully thought out.
I find that most lockfree development uses acquire/release, not SC, so
Note also that according to http://msdn.microsoft.com/en-us/library/ms235435(v=vs.90).aspx (Supported Platforms (Visual C++)) VC8 targets only x86/x64 and Itanium. After Intel clarified x86/x64 MM back in 2008, we know that x86/x64 MM is basically TSO, that is, acquire/release + remote write atomicity. Itanium MM explicitly defines WB release stores to have remote write atomicity. http://download.intel.com/design/itanium/downloads/25142901.pdf (3.3.7.1 Total Ordering of WB Releases) So IRIW is not really a problem for VC8 acquire/release because on VC8 supported platforms remote write atomicity is guaranteed for acquire/release. regards, alexander.