On Sun, 22 Nov 2026 20:41:34 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 pull request now contains 211 commits:
>
> - Merge branch 'openjdk:master' into JDK-8373118
> - Refactor tryTerminate, regularlize constructions, rewrite design doc
> - Use adaptation of previous interference check; long base
> - restore lazySUbmit semantics
> - Repair clobbered line; other misc tunings
> - Revert lazySubmit; add non-public randomSubmit; other misc tunings
> - Merge branch 'openjdk:master' into JDK-8373118
> - Rondomize lazySubmit; balance costs across use cases
> - Merge branch 'openjdk:master' into JDK-8373118
> - Re-remove helpSignalWork
> - ... and 201 more: https://git.openjdk.org/jdk/compare/78bf06f4...cd9ab7ab
src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java line 2051:
> 2049: long stat; int stolen;
> 2050: r ^= r << 13; r ^= r >>> 17; r ^= r << 5; // xorshift
> 2051: if ((stat = scan(w, index, r | 1)) != 0L) {
@DougLea Given that we are now reserving `base` using `TAKING` in `scan`, if we
miss the race to `b == (b = q.cmpxBase(b, nb | TAKING))` we will `break scan;`
in the next loop since `b` will be < 0. This means that we'll immediately go to
`deactivate`, but that's not technically true because we just encountered a
locked base. We should consider improving the strategy in that
situation—backoff, retry, onSpinWait, yield? /cc @AlanBateman
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28797#discussion_r4683541194