[concurrency-interest] jsr166y.forkjoin API comments

Neal Gafter neal at gafter.com
Mon Feb 4 16:58:55 EST 2008


One of the APIs I expect to distribute with the closures prototype provides
a way of doing this:

doConcurrently(
  {=> doSomething(); },
  {=> doSomethingElse(); },
  {=> andNowForSomethingComplelelyDifferent(); }
);

Regards,
Neal

On Feb 4, 2008 1:10 PM, David J. Biesack <David.Biesack at sas.com> wrote:

>
> 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
>
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at altair.cs.oswego.edu
> http://altair.cs.oswego.edu/mailman/listinfo/concurrency-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/attachments/20080204/faa32fd8/attachment.html 


More information about the Concurrency-interest mailing list