[concurrency-interest] AtomicReference.updateAndGet() mandatory updating
martinrb at google.com
Wed May 31 21:34:33 EDT 2017
On Wed, May 31, 2017 at 4:33 PM, Hans Boehm <boehm at acm.org> wrote:
> "compareAndSet and all other read-and-update operations such as
> getAndIncrement have the memory effects of both reading and writing
> volatile variables." strikes me as sufficiently unclear that it's not
> obvious to me we have to do anything. I would probably not have read that
> as implying a write for failing CAS.
I agree. The natural interpretation is that __if__ a write is necessary,
it will have the semantics of a volatile write.
I fully support Hans in this discussion.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Concurrency-interest