On Thu, 8 Jan 2026 18:52:32 GMT, Doug Lea <[email protected]> wrote:
>> Changes signal filtering to avoid possible starvation
>
> Doug Lea has updated the pull request incrementally with two additional
> commits since the last revision:
>
> - Undo unrelated change
> - Re-introduce acquiring array reads; re-arrange to rely on volatile base
> index
src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java line 2063:
> 2061: int idle = IDLE, phase;
> 2062: if ((runState & STOP) == 0L && w != null &&
> 2063: (idle = (phase = w.spinWaitPhase()) & IDLE) != 0) {
@DougLea Not that it'll happen frequently, but it _might_ be worth checking
`(runState & STOP) == 0L` directly after the spinwait, and then switch from a
`for(;;)` to a do-while where the while-condition is `(runState & STOP) == 0L`.
That would avoid the small risk of needing to call setCurrentBlocker twice for
situations where the pool transitions to STOP while the spinwait is running.
It'd be interesting to see if such a change has any discernable impact on
ramp-down for benches that include startup and shutdown as a part of the
benching process.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28797#discussion_r2674309609