ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dmitriy Setrakyan <dsetrak...@apache.org>
Subject Re: Adding compare-and-set method returning value to distributed atomics
Date Thu, 17 Sep 2015 14:20:35 GMT
On Thu, Sep 17, 2015 at 4:19 PM, Pavel Tupitsyn <ptupitsyn@gridgain.com>
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 <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