[concurrency-interest] AtomicReference.updateAndGet() mandatory updating

Martin Buchholz 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...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20170531/5db6f261/attachment.html>


More information about the Concurrency-interest mailing list