RFR: 8297495: j.u.concurrent updates for JDK 20

Jaikiran Pai jpai at openjdk.org
Tue Nov 29 06:46:23 UTC 2022


On Wed, 23 Nov 2022 12:40:05 GMT, Alan Bateman <alanb at openjdk.org> wrote:

> The proposed updates for JDK 20 are:
> 
> - ForkJoinPool.externalSubmit 
> - ForkJoinWorkerThread.getQueuedTaskCount 
> 
> These methods will be used to improve the Thread.yield implementation for virtual threads. The range of alternatives explored include not exposing an API and protected methods such as "offerSubmission". The class description speaks of "external clients" and "submissions from non-ForkJoinTask clients", hence the proposed naming and javadoc text.

I don't have enough knowledge of this area, but the API changes look OK to me. 
With this addition of the `externalSubmit` method should the javadoc of the existing `submit` method be enhanced a bit to explain how it behaves differently as compared to this one and when to choose one over the other. For example, should `submit` API state (its already existing behaviour) that it will use the current worker thread's queue to push this new task if called from the worker thread?

-------------

PR: https://git.openjdk.org/jdk/pull/11319


More information about the core-libs-dev mailing list