RFR: 8297495: j.u.concurrent updates for JDK 20 [v2]

Viktor Klang duke at openjdk.org
Mon Dec 5 10:19:23 UTC 2022


On Thu, 1 Dec 2022 14:46:48 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.
>
> Alan Bateman has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision:
> 
>  - Expand test
>  - Adjust wording to make it clear that the number of tasks is non-negative
>  - Merge
>  - Improve javadoc
>  - Merge
>  - Initial commit

src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java line 2920:

> 2918:      * @since 20
> 2919:      */
> 2920:     public <T> ForkJoinTask<T> externalSubmit(ForkJoinTask<T> task) {

@AlanBateman Does it make sense to check the nullness of the `task` before going into the storeStoreFence etc?

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

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


More information about the core-libs-dev mailing list