[cpp-threads] Failed compare-and-swap

Peter Dimov pdimov at mmltd.net
Mon Jul 30 22:43:48 BST 2007


Paul E. McKenney wrote:

> There are algorithms in which a failed CAS plays a role similar to a
> failed trylock.  So it would make quite a bit of sense for a failed
> CAS to have the same memory-ordering semantics that it would have had
> if successful.  After all, the common case should be successful CAS!
> ;-)

A failed trylock also (arguably) has (should have) no memory synchronization 
properties. 




More information about the cpp-threads mailing list