On Thu, Sep 17, 2015 at 4:19 PM, Pavel Tupitsyn <[email protected]> wrote:
> Hi, > > Looking at other methods in IgniteAtomicLong, it would be > compareAndSetAndGet. Ugly, but consistent. > Agree. > > On Thu, Sep 17, 2015 at 3:36 PM, Vladimir Ozerov <[email protected]> > 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 >
