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

Jaikiran Pai jpai at openjdk.org
Tue Nov 29 06:52:18 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.

test/jdk/java/util/concurrent/tck/ForkJoinPool20Test.java line 48:

> 46:  * Tests for ForkJoinPool and ForkJoinWorkerThread additions in JDK 20.
> 47:  */
> 48: public class ForkJoinPool20Test extends JSR166TestCase {

The new `externalSubmit` API states:

> @implSpec
>  This method is equivalent to {@link #submit(ForkJoinTask)} when called
>  from a thread that is not in this pool.

Should this new test class include a test which verifies this behaviour? As far as I can see, the new test methods that assert the queue counts are  being invoked from within a worker thread.

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

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


More information about the core-libs-dev mailing list