[concurrency-interest] jsr166y.forkjoin API comments

Tim Peierls tim at peierls.net
Tue Jan 29 09:20:38 EST 2008

On Jan 29, 2008 7:21 AM, Doug Lea <dl at cs.oswego.edu> wrote:

> David J. Biesack wrote:
> > sometimes you want fork/join but you don't have an array to operate on;
> you just have a set of indices.
> This suggests creating something like the following.
> class ParallelIntLoop { ... }

In the absence of ParallelIntLoop, and since in the matrix multiplication
case you *do* have an array to operate on, you can use this:

      .createUsingHandoff(b[0], pool) // b[0].length == # cols in result c
      .withIndexedFilter(new IntAndDoublePredicate()
      public boolean op(int j, double ignored) {
          // use j to compute column j of c
          return false;
  }).apply(new DoubleProcedure() {
      public void op(double ignored) {} // never called

This ignores the values in b[0], just using the array for its length.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/attachments/20080129/828636ac/attachment.html 

More information about the Concurrency-interest mailing list