"memory fence"

Hans Boehm hboehm at
Wed Mar 9 17:12:03 UTC 2016

On Wed, Mar 9, 2016 at 3:06 AM, Aleksey Shipilev <
aleksey.shipilev at> wrote:

> In fact, assuming that a synchronized method has any *detached* memory
> semantics is wrong too -- compilers are known to elide associated
> fences. E.g. if ExecutorWrapper is known to never escape a thread, or a
> single thread locks on it, and biases a lock towards itself.
It may not even work at the hardware level, either.  On ARMv8, the lock
may not contain any real fences to start with; memory operations before and
a critical section may all appear to execute inside the critical section,
with the ones
after becoming visible first.


More information about the core-libs-dev mailing list