[jmm-dev] bitwise RMW operators, specifically testAndSetBit/BTS

Doug Lea dl at cs.oswego.edu
Mon Jul 25 12:35:29 UTC 2016

On 07/25/2016 04:54 AM, Andrew Haley wrote:
> I'm still wondering about this one.  I think Doug has said that
> Opaque accesses are coherent but Plain accesses aren't.  I guess
> there's also non-atomic treatment of long and double.

Users familiar with C/C++-11/17 will use Java opaque whenever
they would use C++ atomic-relaxed, and the implementation effects
should be indistinguishable. Which is not the same as saying the specs
can or should be identical (if only because they deal with
different languages). Which sometimes forces formal attention
to distinctions otherwise not worth bothering about.

Reminder of the game plan for VarHandles Javadocs: Initially
use wordings that are frustratingly loose but surely not wrong
with respect to the range of possible rigorous specs.
Improve them when possible.


More information about the jmm-dev mailing list