[concurrency-interest] In-progress ParallelArray changes

Doug Lea dl at cs.oswego.edu
Wed Dec 26 11:37:49 EST 2007


As punishment :-) to those of you who have tried ParallelArray
and related classes and offered suggestions, we're taking
people up on some of them, and doing a round of API updates.

Over the next few days or so, a bunch of changes will be
committed to ParallelArray. The javadocs will precede the
committed changes, so you can see what will be happening
before you can actually run these versions. Snapshots of
the the main javadoc for ParallelArray are at:
http://gee.cs.oswego.edu/dl/jsr166/dist/jsr166ydocs/jsr166y/forkjoin/ParallelArray.html

Here's a summary:

* A full-featured List view accessed via asList: You can
   efficiently perform all List operations (add, remove, etc), on
   ParallelArrays without needing to copy to/from
   lists. This turns out to work more
   nicely in terms of both API and internal mechanics than
   would redefining ParallelArray to itself be a List.
* Static factory methods instead of constructors
* A static defaultExecutor method to make it easier to
   use the same global ForkJoinExecutor across ParallelArrays.
* Elimination of "Int" specializations. As discussed once
   before, having ParallelIntArray and WithIntPapping in addition to
   the Long versions was pretty marginal on performance grounds.
   Adding list views led to enough additional adaptation snags to
   tip the balance against it.
* Better support for set-like operations: allUniqueElements,
   WithFilter.removeAll, binarySearch on sorted arrays, and
   a few others.
* A few method renamings to make the above a bit more consistent.
* Corresponding changes to ParallelDoubleArray and ParallelLongArray
   (that will probably lag those of ParallelArray.)

As always, comments and suggestions would be very welcome.
Continued thanks to those of you who have been trying these out!

-Doug


More information about the Concurrency-interest mailing list