[concurrency-interest] ConcurrentHashMapV8

Dr Heinz M. Kabutz heinz at javaspecialists.eu
Fri Sep 2 09:51:53 EDT 2011


Hi Doug,

we had a look at the CHM yesterday and were wondering why you did not 
explicitly check for MOVED instead of the more obscure

            else if (e.hash < 0)
                tab = (Node[])e.key;

If would be clearer if that had been:

            else if (e.hash == MOVED)
                tab = (Node[])e.key;

Magic constants are usually a bad idea, even with < 0.

Regards

Heinz
-- 
Dr Heinz M. Kabutz (PhD CompSci)
Author of "The Java(tm) Specialists' Newsletter"
Sun Java Champion
IEEE Certified Software Development Professional
http://www.javaspecialists.eu
Tel: +30 69 72 850 460
Skype: kabutz 



On 8/28/11 10:24 PM, Doug Lea wrote:
>
> A candidate replacement for java.util.concurrent.ConcurrentHashMap
> is now available as jsr166e.ConcurrentHashMapV8. This version
> is much more amenable to upcoming support for aggregate
> parallel operations (including, already, method "computeIfAbsent'
> using a stand-in MappingFunction type).
>
> The internal design is interestingly different.
> Read the internal documentation for details.
> (http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/jsr166e/ConcurrentHashMapV8.java?view=log) 
>
>
> Please give it a try, and let us know about experiences.
>
> Links:
>     *  API specs:  http://gee.cs.oswego.edu/dl/jsr166/dist/jsr166edocs/
>     * jar file: http://gee.cs.oswego.edu/dl/jsr166/dist/jsr166e.jar 
> (compiled using Java7 javac).
>     * Browsable CVS sources: 
> http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/jsr166e/
>
>
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest
>


More information about the Concurrency-interest mailing list