[concurrency-interest] ConcurrentHashMapV8 now supports Spliterator

Aleksandar Prokopec aleksandar.prokopec at gmail.com
Wed Jul 4 04:20:17 EDT 2012


Wow, this is great news!
It may allow us to write a wrapper for chmv8 in Scala parallel collections. I wish concurrent skip lists had a similar thing.

Cheers,
Alex
-- 
Aleksandar Prokopec
LAMP, IC, EPFL

Sent from my Android phone with K-9 Mail. Please excuse my brevity.

Doug Lea <dl at cs.oswego.edu> wrote:


In addition to including the compute/computeIfAbsent changes
discussed on this list last week, the updated version of
ConcurrentHashMapV8 contains basic support for performing
parallel (normally via ForkJoin) operations on the keys,
values, or entries of a map.

The added Spliterator interface (see
http://gee.cs.oswego.edu/dl/jsr166/dist/jsr166edocs/jsr166e/ConcurrentHashMapV8.Spliterator.html)
is for now a nested interface that contains a subset of
some functionality likely to be available in JDK8.
There are also three new methods to provide them:
public Spliterator<K> keySpliterator()
public Spliterator<V> valueSpliterator()
public Spliterator<Map.Entry<K,V>> entrySpliterator()
See the Spliterator javadocs for a usage example.

These methods only provide a foothold for writing your
own parallel operations. CHMV8 doesn't now itself supply
the map, filter, reduce, forEach, etc operations expected
to be supported under JDK8 lambda-ized collections. However,
they do enable those familiar with ForkJoin programming
to get a head start evaluating such code you write yourself.
If you do this, please report back any interesting experiences.

The usual 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/

-Doug

_____________________________________________

Concurrency-interest mailing list
Concurrency-interest at cs.oswego.edu
http://cs.oswego.edu/mailman/listinfo/concurrency-interest

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20120704/2776d3f8/attachment.html>


More information about the Concurrency-interest mailing list