[concurrency-interest] jsr166y.forkjoin API comments

Doug Lea dl at cs.oswego.edu
Mon Jan 28 20:47:02 EST 2008

David J. Biesack wrote:
>  ParallelArray replaceWithMappedIndex(Ops.IntToObject op)
>  ParallelArray replaceWithMapping(Ops.Op op)
>  ParallelArray replaceWithMappedIndex(Ops.IntAndObjectToObject op)
> which can be replaced with a single method:
>    ParallelArray mapped(Ops.IntAndObjectToObject op)

Yes. And it is internally somewhat messy to deal with 3 forms.
But my sense is that many if not most uses are not going to
rely much one the array-ness (i..e, indexing) of ParallelArray,
and it would cause the API to be even more awkward to use if
people has to create little IndexedMapper to Mapper adaptors all
the time. So we might as well accept all forms and cope on their

(However, the lack of an indexed-procedure version of apply is
a bug; thanks for pointing it out! This will be added.)

> (Sidebar: I don't see uses of many of the Procedure types actually used anywhere in jsr166y.forkjoin. Defined but not used anywhere are:
> Perhaps these unused interfaces are designated for an upcoming forkjoin ParallelMap.)

Yes, exactly so. The current plan is for something fairly similar to
ParallelArray  -- an array is a "Map" where the keys are indices within
a range. The arbitrary forms of Maps will allow arbitrary keys.


More information about the Concurrency-interest mailing list