[concurrency-interest] ConcurrentHashMap footprint and contention improvements

Charles Fry fry at google.com
Fri Apr 15 11:19:35 EDT 2011

Wouldn't it be sufficient to use Martin's original suggestion of
initializing last to something else (like -1)?


On Fri, Apr 15, 2011 at 10:54, Doug Lea <dl at cs.oswego.edu> wrote:

> On 04/15/11 10:33, Martin Buchholz wrote:
>> The older code that used segment modcounts was more
>> robust/paranoid in the face of concurrently whack-a-mole-dodging
>> entries.
> There is a trade-off here of possibly failing to detect after
> 1<<31 mods (old) versus a checksum collision (new). The latter seems
> slightly more robust. But it is even more paranoidically
> correct to combine them. Will do.
> For others: The issue is what to do in containsValue(v) when
> the map apparently does not contain v but has been changing
> while looking for it. This is surely uncommon but intrinsically
> expensive to deal with. The question is, at what point to you
> give up trying to traverse while the map is active and lock down
> the entire set of tables to force stability.
> -Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20110415/d0ca6aee/attachment-0001.html>

More information about the Concurrency-interest mailing list