[jmm-dev] Make load/store of 64-bit long and double atomic

Aleksey Shipilev aleksey.shipilev at oracle.com
Tue Jul 12 10:19:20 UTC 2016

On 07/12/2016 01:13 PM, Andrew Haley wrote:
> I wonder if a better solution to this might be to make
> VarHandle.{get,set}Opaque atomic on all primitive types.  This gives
> us a way to get atomic operations on 32-bit machines without the
> overhead of volatile accesses.  Being able to read a 64-bit counter
> atomically is very useful.

VarHandle.{get,set}Opaque is single-copy atomic for all primitive types.
Pretty much like C++ std::atomic(..., mem_ord_relaxed).


More information about the jmm-dev mailing list