Re: Semantics of VarHandle CAS methods

2016-07-05 Thread Martin Buchholz
On Thu, Jun 30, 2016 at 10:54 AM, Hans Boehm wrote: > > > In C++ we have sequential consistency of the single memory location > holding > > an atomic (cache coherence). Should we say something about locations > > updated via a VarHandle? If you call weakCompareAndSetAcquire, then the > > spec s

Re: Semantics of VarHandle CAS methods

2016-07-05 Thread Martin Buchholz
On Thu, Jun 30, 2016 at 10:54 AM, Hans Boehm wrote: > > On Thu, Jun 30, 2016 at 7:59 AM, Martin Buchholz > wrote: > > One concrete proposal that removes a method: > > > > Replace > > weakCompareAndSetAcquire and weakCompareAndSetRelease with > > weakCompareAndSetAcquireRelease > > Using standard

Re: Semantics of VarHandle CAS methods

2016-06-30 Thread Martin Buchholz
On Thu, Jun 30, 2016 at 4:19 AM, Doug Lea wrote: > On 06/30/2016 06:38 AM, Martin Buchholz wrote: > >> 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_o

Re: Semantics of VarHandle CAS methods

2016-06-30 Thread Doug Lea
On 06/30/2016 06:38 AM, Martin Buchholz wrote: 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. There are a few flavors of C++

Re: Semantics of VarHandle CAS methods

2016-06-30 Thread Martin Buchholz
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:/

Re: Semantics of VarHandle CAS methods

2016-06-30 Thread Paul Sandoz
> On 30 Jun 2016, at 09:37, Andrew Haley 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

Re: Semantics of VarHandle CAS methods

2016-06-30 Thread Andrew Haley
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 see

Semantics of VarHandle CAS methods

2016-06-29 Thread Martin Buchholz
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.) http://download.java.net/java/jdk9/d