On Sun, 14 Dec 2025 13:06:46 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:
> 
>   Adjust runworker for previous update

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

> 1890:             }
> 1891:             if (q != null && q.base - qbase > 0)
> 1892:                 break;

Crazy idea: Only create new workers on successful CAS if no queue-drift has 
occurred, but always prioritize to wake up sleeping workers regardless?

Suggestion:

                if (v != null) {
                    v.phase = sp;
                    if (v.parking != 0)
                        U.unpark(v.owner);
                } else if (q == null || q.base - qbase == 0)
                    createWorker();

                break;
            }
            if (q != null && q.base - qbase > 0)
                break;

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

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

Reply via email to