ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pavel Tupitsyn <ptupit...@gridgain.com>
Subject Re: Adding compare-and-set method returning value to distributed atomics
Date Thu, 17 Sep 2015 13:19:35 GMT
Hi,

Looking at other methods in IgniteAtomicLong, it would be
compareAndSetAndGet. Ugly, but consistent.

On Thu, Sep 17, 2015 at 3:36 PM, Vladimir Ozerov <vozerov@gridgain.com>
wrote:

> Igniters,
>
> As we know Java implementation of atomics are rather limited because it
> cannot return current value in case of failed CAS. Other modern platforms
> like .Net, WinAPI and GCC have this feature.
>
> We can easily implement this method because we have old value in hands
> during distributed CAS. But how to name it?
>
> - long compareAndSetValue(long, long)?
> - compareAndSetReturnValue(long, long)?
>
> Please share your ideas.
>
> For examples, GCC goes this way:
> __sync_*bool*_compare_and_set
> __sync_*val*_compare_and_set
>
> Vladimir.
>



-- 
-- 
Pavel Tupitsyn
GridGain Systems, Inc.
www.gridgain.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message