While investigating JDK-8185090 I noticed that KeepAliveCache.run could be better implemented.
It looks like this code
for (KeepAliveKey key : keysToRemove) {
removeVector(key);
}
acquires the lock for every key, but we're already holding the lock, and it looks like a simple
removeAll(keysToRemove)
would suffice.
I'm sure there's more low-hanging fruit here, if we cared to fix.
It looks like this code
for (KeepAliveKey key : keysToRemove) {
removeVector(key);
}
acquires the lock for every key, but we're already holding the lock, and it looks like a simple
removeAll(keysToRemove)
would suffice.
I'm sure there's more low-hanging fruit here, if we cared to fix.
- relates to
-
JDK-8155590 Dubious collection management in sun.net.www.http.KeepAliveCache
-
- Closed
-
-
JDK-8185090 Data race in KeepAliveCache
-
- Closed
-