On Sun, 18 Jan 2026 21:07:48 GMT, Doug Lea <[email protected]> wrote:

>> Changes signal filtering to avoid possible starvation
>
> Doug Lea has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Simplify scan mode control by moving and reworking topLevelExec and 
> throwing on trim

src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java line 1299:

> 1297:                             break;                    // lost to pollers
> 1298:                         newArray[k & newMask] = u;
> 1299:                     }

@DougLea Not sure if it helps loop unrolling, but a possible change might be 
something like:


                    for (int k = s - 1, j = cap;
                         j > 0 && (u = (ForkJoinTask<?>)U.getAndSetReference(a, 
slotOffset(k & mask), null)) != null; // lost to pollers
                         --j, --k) {
                        newArray[k & newMask] = u;
                    }

src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java line 1303:

> 1301:                     if (unlock != 1)
> 1302:                         phase = unlock;
> 1303:                     if (pool != null)

@DougLea Are we 100% sure we always need to signal upon resize?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28797#discussion_r2706072253
PR Review Comment: https://git.openjdk.org/jdk/pull/28797#discussion_r2706073001

Reply via email to