It's not only about naming.

So yes, I'd like the name weakCompareAndSet to be the sequentially
consistent version, BUT I'd also expect the next more relaxed version to be
memory_order_acq_rel which we don't provide.

I was surprised that weakCompareAndSetAcquire actually does relaxed writes
http://download.java.net/java/jdk9/docs/api/java/lang/invoke/VarHandle.html#weakCompareAndSetAcquire-java.lang.Object...-

I don't have a good intuition about how useful non-sequentially-consistent
CASes are.


On Thu, Jun 30, 2016 at 1:00 AM, Paul Sandoz <paul.san...@oracle.com> wrote:

>
> > On 30 Jun 2016, at 09:37, Andrew Haley <a...@redhat.com> wrote:
> >
> > On 30/06/16 02:20, Martin Buchholz wrote:
> >> VarHandle.compareAndSet is strong in two ways - non-spurious and
> >> sequentially consistent.
> >>
> >> VarHandle.weakCompareAndSet is weak in both these ways.
> >> (That seems like a mistake to me.
> >> The fact that j.u.c. Atomic classes are a precedent for this seems
> >> unfortunate.)
> >
> > Is your disagreement purely about the name?
>
> I was also wondering if that was the source of disgreement.
>
> Paul.
>
> >  We have all of the variants we need.
> >
>

Reply via email to