Reference.reachabilityFence

Peter Levart peter.levart at gmail.com
Sat Dec 12 11:27:22 UTC 2015


Hi Paul,

Your latest code does not build with jdk9/dev as it uses 
@jdk.internal.vm.annotation.DontInline, but in jdk9/dev the @DontInline 
is still in java.lang.invoke.

Is there a plan to push the move of  DontInline annotation before this 
change as I haven's seen any RFR for the move yet?

Regards, Peter

On 12/11/2015 10:36 AM, Paul Sandoz wrote:
> Unless any strong objections are raised I plan to push the latest path on Monday.
>
>> Updated:
>>
>> http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8133348-reachability-fence-jdk/webrev/src/java.base/share/classes/java/lang/ref/Reference.java.sdiff.html <http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8133348-reachability-fence-jdk/webrev/src/java.base/share/classes/java/lang/ref/Reference.java.sdiff.html>
>>
>> I think there is an opportunity to add further examples, but i would like to take a swing at that later on.
>>
>>
>>> - I now agree with you and Doug about calling this a "fence".  Can we
>>>    just name it "fence" rather than the wordier "reachabilityFence"?
>>>    Looking at a typical invocation,
>>>
>>>        Reference.reachabilityFence();
>>>
>>>    seems a bit redundant while
>>>
>>>        Reference.fence();
>>>
>>>    reads quite nicely.  Is there, or will there ever be, any other kind
>>>    of reference-related fence?
>>>
>> I doubt there will be another kind of reference fence, but it could be used in conjunction with other memory fences (currently on VarHandles) and if static imports are used it might look rather out of place as to what fence “fence” actually refers to. That is why i prefer the longer more descriptive name.
>>
>> Paul.




More information about the core-libs-dev mailing list