Usually for unstable recording you will get the following barriers.
[StoreStore] [LoadStore] x=10 [StoreLoad]
StoreLoad has 2 goals:
- It prevents higher loads up to x = 10.
- he makes all the changes that occurred before the appearance of "x = 10" on other processors.
StoreLoad is potentially expensive since it expects the storage buffer to be exhausted.
The above approach combined with the following for reading X
tmp=x [LoadLoad] [LoadStore]
Ensure that access to the volatile variable is consistent.
A release of only the form will look like this
[StoreStore] [LoadStore] x=10
As you can see, the [StoreLoad] barrier has disappeared.
On the reading side, this is the same as regular mutable reading.
I donโt know how the โrelease-only CAS formโ fits into the image
And, as 8472 already pointed out, the new VarHandles in Java 9 will reveal the unconstrained receipt / release guarantees.
source share