RFR: 8322732: ForkJoinPool may underutilize cores in async mode

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


On Fri, 10 May 2024 08:02:23 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 1405:
> 
>> 1403:                     U.loadFence();
>> 1404:                     if (base != b)
>> 1405:                         ;                              // inconsistent
> 
> @DougLea This seems like it could be a `continue;`, which might be easier to reason about?

You'd think these would be equivalent, but not always so, because of impact on safepoints. More compiler-whispering. But it can be a little more readable by converting to nested if with same effect. Will do.

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

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


More information about the core-libs-dev mailing list