[concurrency-interest] ConcurrentHashMap bulk parallel operations

Doug Lea dl at cs.oswego.edu
Tue Aug 14 09:44:06 EDT 2012


A few small follow-ups:

* One minor usage casualty of the initial merges of jsr166e/j.u.c vs
the old jsr166y is that you may now need to specifically import
particular classes such as ForkJoinPool if you previously used
import * conventions. Sorry.

* While preliminary performance checks are promising, beware that
the very first parallel task execution time can be terrible.
Really terrible. A lot of code needs compiling, threads
need to  be constructed, memory needs to be reserved, etc,
to get going. Hopefully some of this will improve.

* The CHM.Parallel methods deal only with operating on
a CHM once you have one. There are not any parallel-build
methods -- these are out of scope for this class. But
if you have some parallel operations in any other classes
(which are planned for JDK8), it is very easy to use them
to populate a CHM just using a forEach with action
mychm.putIfAbsent(x) (or put, or computeIfAbsent or
whatever).

-Doug



More information about the Concurrency-interest mailing list