[concurrency-interest] jsr166y.forkjoin API comments

David J. Biesack David.Biesack at sas.com
Mon Feb 4 16:10:09 EST 2008


In writing the matrix multiply implementation example ( http://artisans-serverintellect-com.si-eioswww6.com/default.asp?W40 ), the main matmul methods validate the input parameters:

void forkJoinMatrixMultiply(
  final double[][] a,
  final double[][] b,
  final double[][] c) {
  check(a,b,c);
  ...

where check is defined to do

    check(a);
    check(b);
    check(c);
    ...

There is no reason these three inner calls cannot occur concurrently.

I'd really like the equivalent of Fortress' do ... also do ... blocks:

    do
       doSomething();
    also do
       doSomethingElse();
    also do
       andNowForSomethingComplelelyDifferent();
    end;

but realize that may be beyond the scope of an API. Not much harm in asking, though: Has any thought been given to facilitating concurrent block execution more directly (and less verbosely) using FJ Procedures?

It's easy to wrap the above in Ops.Procedures and use a ParallelArray (or as Runnables for ExecutorService), but there's a lot of boilerplate and the actual application code gets lost pretty easily.

-- 
David J. Biesack     SAS Institute Inc.
(919) 531-7771       SAS Campus Drive
http://www.sas.com   Cary, NC 27513



More information about the Concurrency-interest mailing list