On Sun, 10 Jan 2021 17:01:31 GMT, Attila Szegedi <att...@openjdk.org> wrote:
>> Yes, the pre-initialized fields to Map.of() are safe regardless of whether >> they are volatile or not (so I would keep them non-volatile to optimize >> fast-path). Because the BiClassValues instance is published safely to other >> threads via ClassValue and because you never assign null to the fields later >> on. > > Alright, I made a new hybrid of non-volatile fields and never null fields. > Hopefully we're getting to the ideal. Again, I really appreciate all the > advice and direction you provided here. Hello Attila, This looks good to me. Just a question: How frequent are situations where the two classloaders are unrelated? ------------- PR: https://git.openjdk.java.net/jdk/pull/1918