[concurrency-interest] jsr166y reorganization and updates

Doug Lea dl at cs.oswego.edu
Tue Jan 6 10:53:12 EST 2009


Tim Peierls wrote:
>
> :-( Sorry to hear that. 

Reasoning:
ForkJoinPool implements ExecutorService method
   invokeAll(Collection<Runnable>),
ForkJoinTask implements the analogous form
   invokeAll(Collection<ForkJoinTask>)
and also the var-arg version
   invokeAll(ForkJoinTask ...)
which is further specialized to the two-task case
   invokeAll(ForkJoinTask t1, ForkJoinTask t2)
So the specialization for the one-task case would be
   invokeAll(ForkJoinTask t)
or the less odd-sounding
   invoke(ForkJoinTask t)
or using more standard OO conventions
   t.invoke().
which differs from
   ForkJoinPool.invoke(ForkJoinTask t)
in that t.invoke() always begins execution in the
current thread, while FJP.invoke(t) might not (and
usually doesn't).

-Doug



More information about the Concurrency-interest mailing list