RFR: 8322732: ForkJoinPool may underutilize cores in async mode

Doug Lea dl at openjdk.org
Fri May 10 11:51:51 UTC 2024


On Fri, 10 May 2024 08:08:05 GMT, Viktor Klang <vklang at openjdk.org> wrote:

>> This set of changes address causes of poor utilization with small numbers of cores due to overly aggressive contention avoidance. A number of further adjustments were needed to still avoid most contention effects in deployments with large numbers of cores
>
> src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java line 1432:
> 
>> 1430:         final void topLevelExec(ForkJoinTask<?> task, WorkQueue src,
>> 1431:                                 int srcBase, int cfg) {
>> 1432:             if (task != null && src != null) {
> 
> @DougLea Is this ever invoked with a null-task and a null-queue? 🤔

No. This is one of many hoisted null checks that help compilers avoid throwing null pointer exceptions where we don't want them.  Usually I mark these with " // always true", which I'll add here.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19131#discussion_r1596655269


More information about the core-libs-dev mailing list