[concurrency-interest] AtomicReference weakCompareAndSet "Mayfailspuriously"?

Bob Lee crazybob at crazybob.org
Sun May 28 23:08:18 EDT 2006


On 5/28/06, Pete Soper <pete at soper.us> wrote:
> The race is between the write of int[] and int[]{1} but it's enabled by
> the lack of atomicity of the CAS.

The CAS itself is atomic, right? The problem now is with the int[]
which is exposed to two threads with no barrier. If we were doing a
weak CAS of an int, this wouldn't be an issue, right?

Bob



More information about the Concurrency-interest mailing list