RFR: 8309622: Re-examine the cache mechanism in BaseLocale [v2]
Naoto Sato
naoto at openjdk.org
Tue Jun 13 18:00:53 UTC 2023
On Tue, 13 Jun 2023 11:22:11 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> Naoto Sato has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Addressing comments (test grouping, synchronization), minor optimization on loop lookup
>
> src/java.base/share/classes/sun/util/locale/BaseLocale.java line 166:
>
>> 164: // can subsequently be used by the Locale instance which
>> 165: // guarantees the locale components are properly cased/interned.
>> 166: synchronized (BaseLocale.class) {
>
> The simplification is good but I wonder if this coarse locking is going to be a problem, do we need to use some concurrent to avoid contention here?
Replaced it with a ReentrantLock
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14404#discussion_r1228504526
More information about the core-libs-dev
mailing list