[concurrency-interest] ConcurrentHashMapV8

Doug Lea dl at cs.oswego.edu
Sun Oct 2 18:29:39 EDT 2011

An update to jsr166e.ConcurrentHashMapV8 includes two
suggested changes that can affect usage:

* The "compute" method now supports read-modify-write
by using a function that provides the previous value.

* Both computeIfAbsent and compute now throw NullPointerException
(leaving old mapping or lack thereof intact) if the function returns

Plus some other improvements.

While I'm at it...

On 09/30/11 12:58, Jason T. Greene wrote:
>> [... overriding default load factor  ... ]
> What about just limiting the upper range? I could see someone dropping the
> default load factor to get marginally better throughput.

Although even in that case, the overrides were previously
not handled consistently, and by allowing overridden load
factor to affect initial sizing, we still support it about
as well as before, but can now clearly specify the effects.
The lack of clarity arose from a series of inconsistent
decisions (some of them mine) to more-or-less mimic
the already-inconsistent policies of the original HashTable
class. Unclear enough that if someone wanted to backport
the CHMV8 code but not the clarified specs to previous JDKs,
I don't think any user could tell the difference in the
effects of overriding load factor.


More information about the Concurrency-interest mailing list