[concurrency-interest] AtomicReference.updateAndGet() mandatory updating

Doug Lea dl at cs.oswego.edu
Thu Jun 1 10:11:59 EDT 2017


On 06/01/2017 08:25 AM, Doug Lea wrote:

> 
> But the main underlying requirements are that each CAS is atomic and
> in the total synchronization order, whether it succeeds or fails.
> 
> Maybe we should just say this.
> 

If so, we'd need to compromise on the stance in VarHandle specs of
not referring to properties of the non-existent JMM revision.
Instead, they incompletely specify in terms of reorderings.
But it seems possible to improve this without committing to
anything not certain to appear in revised JMM. We could add
the following paragraph to top level VarHandle docs, that
is informative even without rigorous definition of terms.
Comments and suggestions welcome.

 *
 * <p>Access modes may be used to control memory consistency
 * properties.  Atomic <em>Volatile</em> operations are totally
 * ordered with respect to each other. Atomic <em>Release/Acquire</em>
 * operations are partially ordered: acquires and their subsequent
 * accesses are ordered after matching releases and their previous
 * accesses. Atomic <em>Opaque</em> operations are coherently ordered
 * only with respect to accesses to the same variable.  Other
 * <em>Plain</em> accesses are atomic only for references and
 * primitive values of at most 32 bits, and impose no observable
 * ordering constraints with respect to threads other than the
 * executing thread.


...Added before parag starting:
 * <p>Access modes are grouped into the following categories:


More information about the Concurrency-interest mailing list