RFR: 8314480: Memory ordering spec updates in java.lang.ref [v2]

Brent Christian bchristi at openjdk.org
Wed Dec 6 01:27:39 UTC 2023


On Tue, 21 Nov 2023 09:16:17 GMT, Viktor Klang <vklang at openjdk.org> wrote:

>> src/java.base/share/classes/java/lang/ref/Reference.java line 564:
>> 
>>> 562:      * {@code reachabilityFence(x)}
>>> 563:      * <a href="{@docRoot}/java.base/java/util/concurrent/package-summary.html#MemoryVisibility"><i>happen-before</i></a>
>>> 564:      * the garbage collector clears any reference to {code x}.
>> 
>> This is a fairly low-level specification, so the relationship described here is "reachabilityFence **hb** clearing". The relationships "clearing **hb** enqueue" and "enqueue **hb** dequeue" are described elsewhere. Thus the mention of Cleaner above seems misplaced.
>> 
>> However, the whole chain of relationships
>> 
>>> RF **hb** clearing **hb** enqueue **hb** dequeue **hb** cleaning-action
>> 
>> is important. Should this be described somewhere?
>
> Perhaps in each of these places add a link to #Memory Consistency Properties

I can flesh out the new Memory Consistency Properties section in the package info to cover the whole chain. Adding links to it sounds like a good idea.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/16644#discussion_r1416512195


More information about the core-libs-dev mailing list