[concurrency-interest] ForkJoinTask.externalAwaitDone() co-operates only with commonPool?
dl at cs.oswego.edu
Sun Feb 5 10:53:33 EST 2017
On 02/05/2017 10:34 AM, Ruslan Cheremin wrote:
> Tracing the execution of FJTask.join() I've found the code
> externalAwaitDone() (listed below), from which it is obvious external
> (non-FJP) thread will try to help to execute tasks _only from
> commonPool_, and just blocks otherwise.
Threads in all cases try to help, but in non-commonPool they may
reach a point where they block sooner than in common pool,
where they must continue to find and help with tasks vs
block in case there are no other workers, until/unless they
are sure that they are not needed.
There are methods allowing manual control of this extra helping
in non-commonpool usage. For example helpQuiesce and helpComplete.
They are not performed otherwise because they can cause unnecessary
More information about the Concurrency-interest