Subj : Re: Memory Barriers, Compiler Optimizations, etc. To : comp.programming.threads From : Alexander Terekhov Date : Mon Feb 07 2005 01:57 pm Joseph Seigh wrote: > > On Mon, 07 Feb 2005 12:13:10 +0100, Alexander Terekhov wrote: > > > > > "Neill Clift [MSFT]" wrote: > > [...] > > >> I believe we do have a full barrier > > > > I believe that barrier makes little sense in the case of > > comparison failure. > > > What are you saying? That failed compare and swaps shouldn't > have memory barrier semantics? Yes (actually "unspecified"). Just like with failed pthread_mutex_trylock(). See XBD 4.10. "Unless explicitly stated otherwise, if one of the above functions returns an error, it is unspecified whether the invocation causes memory to be synchronized." regards, alexander. .