RFR (XS): CR 8004330: Add missing Unsafe entry points for addAndGet() family

Aleksey Shipilev aleksey.shipilev at oracle.com
Wed Jan 9 13:04:32 UTC 2013

On 01/09/2013 05:02 PM, Doug Lea wrote:
> The main point to keep in mind is that the fallback wrapper
> (unsafe.cpp  Unsafe_CompareAndSwapLong) does what you
> expect (uses the enclosing lock), unless you are in an
> uncommon (and possibly non-existent) situation where
> you  need/expect something else.

Ok, so the bottom-line seems to be:
 a) Unsafe provides the essential semantics for long updates, even in
the absence of long CASes on target hardware.
 b) New Unsafe code from this CR relies on Unsafe methods semantics from
(a), thus making David's worries ungrounded.
 c) While existing, Java-level AtomicLong.VM_SUPPORT_LONG_CAS is
redundant, and can be eliminated. AtomicLongFieldUpdater can be
rewritten to use Unsafe on all the paths.


More information about the core-libs-dev mailing list