[concurrency-interest] CHMv8 and Bulk update operations.

Doug Lea dl at cs.oswego.edu
Mon Aug 26 06:24:05 EDT 2013

On 08/24/2013 01:16 PM, Kasper Nielsen wrote:
> Hi,
> I've been wondering why there aren't any bulk parallel update operations such as:
> void removeAll(BiPredicate<K,V>)
> void computeAll(BiFunction<K,V,V>)
> in CHMv8. (replaceAll is serial and does not allow removes)
> I have been needing them a couple of times.
> Technical issues?

There is no java.util.Stream API for Pairs, Map.Entries, or any
other compound type. But CHM has a secondary parallel API
to handle these cases. For example, you could do
  chm.forEachKey(1, (k) -> pred(k) ? k : null, (k) -> remove(k));
This secondary API is sometimes a little awkward to use, but
gives you complete control.


More information about the Concurrency-interest mailing list