Yes. You are correct.

________________________________
From: Charles Oliver Nutter <[email protected]>
Sent: Wednesday, May 21, 2025 3:53 PM
To: Remi Forax <[email protected]>
Cc: Da Vinci Machine Project <[email protected]>; Chen Liang 
<[email protected]>
Subject: [External] : Re: Years later, finally integrating ClassValue... but...

Ok thanks for the confirmations!

If I'm understanding correctly, in the future the way to guarantee once-only 
initialization of a ClassValue would be to have it produce a StableValue, of 
which only one will be installed, and which will then be guaranteed by the JVM 
to have once-only initialization and a foldable, stable result. Until that is 
generally available, I should use a factory object with double-checked locking 
to ensure once-only initialization (which is essentially what my own ClassValue 
did, but built as a wrapper around java.lang.ClassValue).
_______________________________________________
mlvm-dev mailing list
[email protected]
https://mail.openjdk.org/mailman/listinfo/mlvm-dev

Reply via email to