I have accidentally run into Striped64.java class from Kamon Monitoring tool. At line 95 I found this comment:
JVM intrinsics note: It would be possible to use a release-only
form of CAS here, if it were provided.
Although I understand what CAS is, I am unable to find out what a release-only form of CAS is. Could someone shed some light on this?
I am unable to find out what a release-only form of CAS is.
That refers to memory ordering constraints on atomics in the terms of the C++ memory model. Some of those are not fully expressible in the terms of the java memory model which predates the C++ one (see also the JMM cookbook for developers) and thus they are currently not made available through the standard library.
This will change with Java9 where varhandles will expose memory accesses that match C++ semantics, except consume order.
Also note that the java class you linked has been copied from the jsr166 repository, which is the upstream version of the JDK j.u.c. packages.