[cpp-threads] std::atomic<> in acquire-release mode and write atomicity

Paul E. McKenney paulmck at linux.vnet.ibm.com
Tue Dec 16 00:00:54 GMT 2008


On Mon, Dec 15, 2008 at 12:30:15PM +0100, Alexander Terekhov wrote:
> Given
> 
> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2745.html

FWIW, there is an updated version of N2745 here:

http://www.rdrop.com/users/paulmck/scalability/paper/N2745r.2008.09.20a.html

Raul and I could officially publish an update at some point if people
would like.  There was some issue with the CD being out the last time
I checked, but presumably the "blackout period" from that will end at
some point.

> are we all in agreement that std::atomic<> in acquire-release mode
> provides classic release consistency without any write atomicity
> (total order for release stores) RCpc model and neither something like
> RCtso (e.g. Itanium's acquire-release under which even IRIW works just
> fine) nor some "causal" model like current x86 (IRIW fails without
> XCHG but other "causality" examples work without XCHG for release
> stores).

I agree that std::atomic<> in acquire-release mode does not support IRIW.
Whether this is due to a failure to totally order stores or a failure
to provide cumulativity to loads is a philosophical point, at least from
what I can tell.  ;-)

> How is this reflected in the current draft? (I've frankly lost track
> of relevant definitions and possible interpretations... :-) )

How about paragraph 5 from section 1.10, last note: "[ Note: There is a
separate order for each scalar object. There is no requirement that these
can be combined into a single total order for all objects.  In general
this will be impossible since different threads may observe modifications
to different variables in inconsistent orders. — end note ]"

Or look at 1.10 paragraph 10, and note that independent non-SC stores
won't have a inter-thread happens-before relationship.  The total-order
guarantee for SC operations appears in 29.1 paragraph 2.

Or am I missing the point?

							Thanx, Paul

> TIA.
> 
> regards,
> alexander.
> 
> -- 
> cpp-threads mailing list
> cpp-threads at decadentplace.org.uk
> http://www.decadentplace.org.uk/cgi-bin/mailman/listinfo/cpp-threads



More information about the cpp-threads mailing list