RFR: 8322732: ForkJoinPool may underutilize cores in async mode [v17]
Viktor Klang
vklang at openjdk.org
Mon Jun 3 12:26:06 UTC 2024
On Mon, 3 Jun 2024 11:16:49 GMT, Doug Lea <dl at openjdk.org> wrote:
>> src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java line 1345:
>>
>>> 1343: int b = base, p = top, cap;
>>> 1344: if (p - b > 0 && a != null && (cap = a.length) > 0) {
>>> 1345: for (int m = cap - 1, s, nb;;) {
>>
>> @DougLea I'm curious, what effect did you see if moving the `p - b > 0` out of the loop conditional?
>
> This was part of saving a read in the common case of empty local queue. Barely but reliably worth doing.
👍
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19131#discussion_r1624352663
More information about the core-libs-dev
mailing list