[concurrency-interest] AtomicXXX.lazySet and happens-before reasoning

Ruslan Cheremin cheremin at gmail.com
Fri Oct 7 17:44:52 EDT 2011


> It also needs a LoadStore fence, in both cases.

But why lazySet needs LoadStore fence? It seems what lazySet javadoc
does not put any ordering constraints on loads...

> In particular, if v is volatile (and certainly if it's accessed using lazySet), and x and y are ordinary variables,
> then the assignments to x and y in the following may be visibly reordered:
> x = 1;
> v = 2;
> y = 3;

You mean what vstore is not "transparent" upside down, but
"transparent" downside up, so this

y=3
x=1
v=2

is allowed reordering?



More information about the Concurrency-interest mailing list