[concurrency-interest] AtomicReferenceweakCompareAndSet "Mayfailspuriously"?

Jeremy Manson jmanson at cs.purdue.edu
Mon May 29 11:46:02 EDT 2006

Doug Lea wrote:
> Jeremy Manson wrote:
>> I'm probably being dim, but why don't you need the happens-before 
>> relationship here between the setter and a subsequent getter?  It 
>> seems to me that you need the release on fixedNext...  No?
> Remember that all threads are running the same code. As long as any
> of them see inconsistencies, they will try to fix and then restart.
> So, that CAS is OK being asynchronous wrt any of them. Just using
> weakCAS might further delay progress of any for which the CAS fails, but
> this might empirically be faster than using a hard LL/SC spin underlying
> strong CAS on some machines.
> -Doug

Oh, I see.  I didn't understand what inconsistent() did.


More information about the Concurrency-interest mailing list