[concurrency-interest] Suggestion: .hardGet() for atomic variables

Raph Frank raphfrk at gmail.com
Thu Jan 19 15:44:33 EST 2012

On Thu, Jan 19, 2012 at 8:28 PM, Ruslan Cheremin <cheremin at gmail.com> wrote:
> Actually you still can implement your "hard get" (which is actually
> seems like LoadLoadBarrier + vload) with non-numeric types as
> atomicRef.compareAndSet(current, current) -- it is exactly the code to
> which getAndAdd(0) will be actually transformed (AFAIK).

Also, just to confirm, getAndAdd(0) will count as a write for working
out thread syncing ?

More information about the Concurrency-interest mailing list