[cpp-threads] Causality on more than two processors, write atomicity

Peter Dimov pdimov at mmltd.net
Sat Sep 3 21:36:26 BST 2005


There is a discussion in comp.programming.threads, in which the following 
example:

P1: Y = 1;
P2: if( Y == 1 ) { Z = 1; }
P3: if( Z == 1 ) { assert( Y == 1 ); }

is claimed to legitimately assert under "processor consistency" - the memory 
model that the x86 CPUs are supposed to implement, and under all platforms 
that don't exhibit write atomicity (even when all loads are ld.acq and all 
stores are st.rel).

I'm still struggling with this "discovery". How does it affect us? It seems 
to me that this makes ld.acq/st.rel impossible to specify in a 
happens-before framework (because in the above example happens-before is not 
transitive.) I must be missing something.

--
Peter Dimov
http://www.pdimov.com 





More information about the cpp-threads mailing list