On Tue, 21 Nov 2023 09:16:17 GMT, Viktor Klang <[email protected]> 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