[concurrency-interest] ForkJoinTask.externalAwaitDone() co-operates only with commonPool?

Doug Lea dl at cs.oswego.edu
Sun Feb 5 16:44:49 EST 2017


On 02/05/2017 11:33 AM, Ruslan Cheremin wrote:

> May be I miss something important, but I can't see in code how do
> threads tries to help:

Oh, sorry to misinterpret your question. "External" threads
(non-ForkJoinWorkerThreads) by design do not help normal pools,
which makes them act like other ExecutorServices.
(I was referring to "internal" threads in previous answer.)
But they must help in commonPool, mainly because the
commonPool might not have any workers, due to system-wide
policies. Doing it this way enables parallelStreams etc to
still work in managed environments (although with no
possibility of speedup). But this is an add-on to
ForkJoinPools that doesn't apply in general.


>
> Is it because there is no way to find out to which FJPool given FJTask
> was submitted?
>

Yes, although that's more of a consequence rather than a cause.

-Doug



More information about the Concurrency-interest mailing list