[jmm-dev] jdk9 APIs

Doug Lea dl at cs.oswego.edu
Fri Aug 14 18:43:34 UTC 2015


On 08/14/2015 02:17 PM, Paul E. McKenney wrote:
> On Fri, Aug 14, 2015 at 01:57:41PM -0400, Doug Lea wrote:
>> My proposal to just introduce loadLoadFence(ref) (which further
>> simplifies VarHandle.getDependently(ref)) was based in part
>> on Section 3 (of the last version of N4321 I'd seen), that
>> mentions and dismisses the idea of forcing layer-by-layer
>> use of something similar in extended dependency chains.
>> Without an OS kernel full of prior users/code to deal
>> with, this seems to minimally suffice. Especially since in
>> Java, programmers are more willing to use tools that might help
>> automate tiered fence placement. Yes?
>
> Given that you don't have existing code and assuming use of
> fence-placement tools, layer-by-layer decoration might be OK.
>
> The tools propagate the layer-by-layer decoration from the head
> of the dependency chain or some such?
>

Well, no such tools exist yet. But they seem to be possible.
And there are enough performance-obsessed low-level java
programmers that I expect interest in RCU-like techniques
to grow sometime. As mentioned in my post Wednesday, these
usages are basically the same as Java final rules except that
the fences must be explicit. So in principle a tool can insert
using a variant of final-field-check rules -- not a known
variant, but I don't see any serious obstacles.

-Doug




More information about the jmm-dev mailing list