VarHandles & LMAX Disruptor

Aleksey Shipilev aleksey.shipilev at oracle.com
Tue Aug 18 18:10:22 UTC 2015


On 18.08.2015 20:32, John Rose wrote:
> OK, I'm catching up.  To apply the @Contended hack to a range-checked
> structure, I guess we want a @Contended 'length' field, that is stored
> deep past the header of the object.

Yeah, but @Contended is declaration-site.

Therefore:

 a) "length" should then be a synthetic field exposed to a classloader
and other class layout data, since @Contended operates there. But as of
now, "length" is the part of array header metadata, not the field block.
This is a technically intrusive, but contained change.

 b) you would want a "subclass" or a specialization of a particular
array to clearly mark what arrays should be contended. Otherwise, you
are playing the same game: penalizing everyone for a gain in the corner
case. This requires language changes.

If only @Contended was usable at use-sites, then we would be able to
mark individual arrays, and only facing problem (a). But that
prerequisite requires rewiring the entire @Contended machinery, which is
a problem (c) in itself.

Thanks,
-Aleksey





More information about the valhalla-dev mailing list