[concurrency-interest] ForkJoinExecutor.invoke and ForkJoinTask.invoke
tim at peierls.net
Sat Dec 15 10:39:15 EST 2007
On Dec 15, 2007 9:46 AM, Doug Lea <dl at cs.oswego.edu> wrote:
> ForkJoinPool.invoke should allow helping (non-blocking) joins when called
> from FJ tasks, but need not immediately invoke the task, but instead process
> tasks in pool submission order until completion.
I still think renaming FJTask.invoke() to forkJoin() would make this
framework slightly easier to learn and reduce the potential for confusion
with FJPool.invoke(task). This isn't critical with FJPool.invoke doing the
"right thing", but the two kinds of invoke we have now *are* still
different, and I see no reason for a reader to have a moment's indecision
about it, if it can be avoided.
As things stand, I get the misleading impression that FJTask, with the one
method name in common with FJExecutor, is trying to *be* an FJExecutor, and
I end up translating "task.invoke()" to "efficient form of task.fork();
task.join()" in my head just to make sure of the distinction. You could say
that basing names on such impressions is a poor way to go about design, but
I'm pretty sure my own hangups in learning this stuff are shared by others.
Don't we count? (Only to ten, Mudhead. :-))
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Concurrency-interest