[concurrency-interest] ForkJoinPool spawning much more workers than its target parallelism

Doug Lea dl at cs.oswego.edu
Thu Oct 7 06:28:23 EDT 2010

On 10/07/10 05:55, Antoine CHAMBILLE wrote:
> I wanted to close this thread, like 95% of the time the issue was in the
> code of our application:

But thanks for reporting this anyway, because this...

> One of the fork join tasks was submitting its child tasks directly to the
> fork join pool, instead of properly forking them.

... confirms that the differences between pool.invoke(task)
and task.invoke() (or related forms like submit) are still subtle
and error-prone. (See also the postings a few months ago
by Dan Grossman about student experiences.) I had announced
plans to change this by trapping self-pool invokes, but
we backed most of this out after noticing that doing so
led to a different form of surprise, about behavior on
shutdown. But I now see that backing it out was a mistake.
Instead, I'll look into a more careful form of bypass that
preserves conformance to both specs and expectations about
both forms of invocation.


More information about the Concurrency-interest mailing list