[concurrency-interest] Scalability of ConcurrentHashMap#computeIfAbsent

Doug Lea dl at cs.oswego.edu
Thu Jul 6 10:47:17 EDT 2017


On 07/06/2017 10:14 AM, Benoit Daloze wrote:

> I have been chasing a scalability problem that only happens with over 8
> cores on my benchmark and it turns out
> ConcurrentHashMap#computeIfAbsent when used as a cache with the same key
> does not scale.

Please try this using JDK9, which locks only on (possible) hash
collision. (See discussion in list archives.)
If we had known that JDK9 would face so much adoption delay,
we might have tried to arrange backports of this and other minor
improvements and fixes...

-Doug



More information about the Concurrency-interest mailing list