RFR: 8314480: Memory ordering spec updates in java.lang.ref [v9]
Y. Srinivas Ramakrishna
ysr at openjdk.org
Fri Feb 23 20:21:01 UTC 2024
On Thu, 22 Feb 2024 23:43:41 GMT, Brent Christian <bchristi at openjdk.org> wrote:
>> Thanks for finding my misspelling, djelinski. 👍
>
> The use of "(un)successful(ly)" in relation to `Reference.enqueue()` is quite deliberate (and builds on the previous wording, "successful").
>
> The intention was to use it consistently (is that not the case somewhere?). For example, it's also used in the new **Memory Consistency Properties** section of the `java.lang.ref` package docs ("The enqueueing of a reference...by a successful call to `Reference.enqueue()`...").
>
> A "successful call to `enqueue()`" is meant to be shorthand for:
> "the reference has been enqueued, and the enqueuing was performed by the `enqueue()` method (rather than by the garbage collector). Therefore there is a _happens-before_ edge between the `enqueue()` method call and the dequeuing of the Reference (whereas there would not be this _happens-before_ if the GC had already enqueued the Reference at the time of the `enqueue()` call)."
>
> The text emphasis with italics is to indicate this added significance of the result of the `enqueue()` call -- ala `happens-before`.
>
> I'm not aware of a similar scenario covered in the JLS, so AFAIK there is not precedent to be consistent with in that regard.
Sounds good, thanks!
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16644#discussion_r1501127639
More information about the core-libs-dev
mailing list