[jdk17] RFR: JDK-8225667: Clarify the behavior of System::gc w.r.t. reference processing [v2]
Peter Levart
plevart at openjdk.java.net
Fri Jul 2 09:04:03 UTC 2021
On Fri, 2 Jul 2021 08:52:28 GMT, Peter Levart <plevart at openjdk.org> wrote:
>> src/java.base/share/classes/java/lang/Runtime.java line 662:
>>
>>> 660: * or that any particular number of {@link java.lang.ref.Reference Reference}
>>> 661: * objects will be cleared and enqueued.
>>> 662: * <p>
>>
>> Hi Mandy,
>> I'm not a native speaker so this might be wrong thinking: The word "determine" feels to me like saying "cause". But running System.gc never actually causes the change of reachability (well it does, when the Reference object is cleared, the reachability of referent changes from Weakly/Softly/Phantom-reachable to unreachable, but I don't think you had that in mind. Or did you?). What would you say about using word "detect" instead? Please others, do say if my thinking is wrong...
>
> Well, "determine" seems to have both meanings:
> https://www.google.com/search?q=determine
> So by the 2nd meaning, it is good.
... and considering the "Schrödinger's cat", even the 1st interpretation is correct. You can't know whether the cat is dead or not until you "determine" it's death. This does not mean that you killed it though.
-------------
PR: https://git.openjdk.java.net/jdk17/pull/183
More information about the core-libs-dev
mailing list