API review of VarHandles

Vitaly Davidovich vitalyd at gmail.com
Fri Jan 22 13:09:29 UTC 2016

On Friday, January 22, 2016, Andrew Haley <aph at redhat.com> wrote:

> On 01/22/2016 11:15 AM, Vitaly Davidovich wrote:
> > I'm guessing opaque is compiler only fence because a method that a
> > compiler doesn't inline (as an example) is considered "opaque" to
> > the compiler and serves like a fence.  Perhaps that's how opaque
> > ended up here.  At any rate, I think it's a poor name.
> Humm.  I guess so, but I'm not sure why you'd want a compiler fence in
> Java.  It's not like C where you can access memory-mapped I/O.  I
> suppose it disallows roach-motel code motion.

Well that's part of my confusion on what this is :).  C++ relaxed makes
sense to me - don't care about anything other than atomicity, which could
be useful for Java too so that one could reliably/portably do atomic stores
to, e.g, longs and have that compile to plain mov on 64 bit machines and
something possibly more expensive on 32 bit.  Maybe that's what this
actually is but "program order" is too vague here.

> Andrew.

Sent from my phone

More information about the valhalla-dev mailing list