[concurrency-interest] Difference between AtomicReference.getPlain() and getOpaque()

Никита Маршалкин marnikitta at gmail.com
Sun Oct 15 04:54:04 EDT 2017


Here's note by Doug Lea on memory orderings in JDK 9.

http://gee.cs.oswego.edu/dl/html/j9mm.html

On Sun, Oct 15, 2017 at 11:38 AM, Florian Weimer <fw at deneb.enyo.de> wrote:

> Are these methods essentially the same?  I think so, based on JLS §17.7:
>
> | Writes to and reads of references are always atomic, regardless of
> | whether they are implemented as 32-bit or 64-bit values.
>
> I assume there is a difference between getPlain() and getOpaque() for
> AtomicLong because of potentially non-atomic access: I assume
> getOpaque() rules that out (but that is not very clear), but
> getPlain() obviously does not.
>
> Whatabout AtomicInteger and AtomicBoolean?  Do these methods show a
> difference there?
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest
>



-- 
Yours sincerely,
Nikita Marshalkin.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20171015/f8eeb8fb/attachment.html>


More information about the Concurrency-interest mailing list