RFR: 8276660: Scalability bottleneck in java.security.Provider.getService() [v2]

Valerie Peng valeriep at openjdk.java.net
Tue Nov 30 01:54:07 UTC 2021


On Thu, 25 Nov 2021 10:41:32 GMT, Andrey Turbanov <duke at openjdk.java.net> wrote:

>> Valerie Peng has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Updated to use pattern matching with instanceof operator.
>
> src/java.base/share/classes/java/security/Provider.java line 1295:
> 
>> 1293:             Service s = legacyMap.get(key);
>> 1294:             if (s != null && !s.isValid()) {
>> 1295:                 legacyMap.remove(key);
> 
> I wonder if it's better to use `legacyMap.remove(key, value);` here. What if another thread put some other value by the same key?

Sure, I can do that.

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

PR: https://git.openjdk.java.net/jdk/pull/6513



More information about the security-dev mailing list