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

Ruslan Cheremin cheremin at gmail.com
Thu Jan 19 15:48:04 EST 2012


current == value you've just read by .get() few lines ago.

2012/1/20 Raph Frank <raphfrk at gmail.com>:
> 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).
>
> Thanks, can "current" be any non-null reference?
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest


More information about the Concurrency-interest mailing list