RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v3]

Mandy Chung mchung at openjdk.org
Wed Jul 5 19:35:57 UTC 2023


On Tue, 4 Jul 2023 12:55:22 GMT, Jim Laskey <jlaskey at openjdk.org> wrote:

>> java.lang.runtime.ReferencedKeyMap was introduced to provide a concurrent caching scheme for Carrier objects. The technique used is generally useful for a variety of caching schemes and is being moved to be shared in other parts of the jdk. The MethodType interning case is one example.
>
> Jim Laskey has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Update to use VirtualThread friendly stale queue.

`WeakReferenceKey::equals` and `SoftReferenceKey::equals`:

Instead of `return Objects.equals(get(), obj);`, suggest to do:


    return refersTo(obj);

-------------

PR Review: https://git.openjdk.org/jdk/pull/14684#pullrequestreview-1515202443


More information about the core-libs-dev mailing list