[cpp-threads] Failed compare-and-swap

Chris Thomasson cristom at comcast.net
Mon Jul 30 03:42:37 BST 2007


----- Original Message ----- 
From: "Peter Dimov" <pdimov at mmltd.net>
To: "C++ threads standardisation" <cpp-threads at decadentplace.org.uk>
Sent: Sunday, July 29, 2007 7:23 PM
Subject: Re: [cpp-threads] Failed compare-and-swap


> 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.

[...]

Makes sense. Although, there is a lot of win32 code out there that uses the 
return value of a failed InterlockedCompareExchange... Humm... If Microsoft 
changes this behavior, it will render all that code into a massive fuc%ing 
race-condition. 




More information about the cpp-threads mailing list