[jmm-dev] weakCompareAndSet memory semantics

Doug Lea dl at cs.oswego.edu
Wed Apr 20 11:56:06 UTC 2016

On 04/20/2016 06:03 AM, Andrew Haley wrote:
> On 20/04/16 10:55, Aleksey Shipilev wrote:
>> I wonder if that was the intended use for weakCAS in C++11, and if so,
>> shouldn't we re-spec weakCAS in Java to have volatile/seq_cst memory
>> effects?
> Probably.  Or, at least, we want a weakCompareAndSet which is sequentially
> consistent.  As a general principle: we have an opportunity to make Java's
> operators consistent with those of C++, and we shouldn't mess that up.

Yes. I'm not sure what happened to method weakCompareAndSetVolatile
that was in early sketches but disappeared (probably my fault) without
me or anyone else noticing. Aleksey and/or Paul: Can you add this?


More information about the jmm-dev mailing list