[cpp-threads] Failed compare-and-swap

Peter Dimov pdimov at mmltd.net
Mon Jul 30 22:45:05 BST 2007


Lawrence Crowl wrote:
> On 7/29/07, Peter Dimov <pdimov at mmltd.net> wrote:
>> Lawrence Crowl wrote:
>>> Are the synchronization semantics of a failed compare-and-swap
>>> any different from those of a successful one?
>>
>> I think that a failed CAS should not be required to perform any
>> memory synchronization.
>
> At the very least, the memory model needs to say something about
> any value read.  Should we say it is equivalent to load relaxed?
> (I'm not sure how that plays with the folks that want to program
> to sequential consistency.)

A seq_cst CAS should probably still be sequentially consistent even in the 
failure case, or it would break the SC model. 




More information about the cpp-threads mailing list