API review of VarHandles

Martin Buchholz martinrb at google.com
Mon Jan 25 22:08:41 UTC 2016

This is my first attempt to understand  java.lang.invoke. It seems
like a new alien world, non-java-like.  I'll need to rebuild my
internal performance model of java code, perhaps by staring at jit
compiled code.

I expect new APIs for atomic variable access to appear in
j.u.c.atomic, not j.l.invoke.  Aleksey has made atomic updaters fast.
Can we continue on that road, providing more updaters or more methods
on current updaters?

Sequential consistency is much easier than release/acquire, which is
in turn much easier than load/load store/store. (using the latter is
almost always a mistake?)
Memory ordering combined with variables is easier than independent fences.
I continue to be uneasy about handing out the sharpest knives in public APIs.
We're not providing much in the way of scare text to get users to think twice.

More information about the valhalla-dev mailing list