On Tue, 7 May 2024 22:50:18 GMT, Doug Lea <d...@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? src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java line 1412: > 1410: if (stalled) > 1411: Thread.onSpinWait(); > 1412: stalled = true; @DougLea Performance-wise, does it make any difference to make the write to `stalled` in an `else-branch` to avoid writing it every time beyond the initial? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/19131#discussion_r1596410561 PR Review Comment: https://git.openjdk.org/jdk/pull/19131#discussion_r1596413050