On Fri, 2 Jan 2026 20:46:53 GMT, Doug Lea <[email protected]> wrote:
>> Changes signal filtering to avoid possible starvation
>
> Doug Lea 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 24 additional commits since
> the last revision:
>
> - Merge branch 'openjdk:master' into JDK-8373118
> - Not sure why this merge is necessary
> Merge remote-tracking branch 'refs/remotes/origin/JDK-8373118' into
> JDK-8373118
> - Merge branch 'openjdk:master' into JDK-8373118
> - Fix deactivate; faster quiescence
> - recheck avoiding cross-class offsets
> - Merge branch 'openjdk:master' into JDK-8373118
> - Merge branch 'openjdk:master' into JDK-8373118
> - Check reworked ordering control
> - Merge branch 'openjdk:master' into JDK-8373118
> - Merge branch 'openjdk:master' into JDK-8373118
> - ... and 14 more: https://git.openjdk.org/jdk/compare/016cc33f...556c5201
src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java line 1307:
> 1305: ForkJoinTask<?>[] a = array;
> 1306: int b = base, s = top - 1, cap;
> 1307: if (a != null && s - b >= 0 && (cap = a.length) > 0) {
Would it help to make the assignment to `cap` be `(cap = a.length - 1) >= 0`
and then eliminate the `(cap - 1)` in the slotOffset calculations on both sides
of `fifo`-branches?
src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java line 1334:
> 1332: final ForkJoinTask<?> nextLocalTask() {
> 1333: U.loadFence(); // ensure ordering for external callers
> 1334: ForkJoinTask<?> t= nextLocalTask(config & FIFO);
nit
Suggestion:
ForkJoinTask<?> t = nextLocalTask(config & FIFO);
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28797#discussion_r2658510000
PR Review Comment: https://git.openjdk.org/jdk/pull/28797#discussion_r2658510564