RFR: 8373118: Test java/lang/Thread/virtual/Starvation.java timed out [v28]

Viktor Klang vklang at openjdk.org
Thu Jan 22 16:58:13 UTC 2026


On Wed, 21 Jan 2026 16:35:41 GMT, Doug Lea <dl at openjdk.org> wrote:

>> Changes signal filtering to avoid possible starvation
>
> Doug Lea has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Try out different approach

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

> 1458:                 ++taken;
> 1459:             }
> 1460:             return taken;

Since `q` can never be null, and `task` initially is never null, perhaps we could do:


        final int topLevelExec(ForkJoinTask<?> task, WorkQueue q, ForkJoinPool pool,
                               int fifo) {
            int taken = 0;
            if (task != null && q != null) {
                ForkJoinPool p = (fifo == 0) ? null : pool;
                do {
                    task.doExec();
                    ++taken;
                } while ((task = nextLocalTask(fifo)) != null || (task = q.tryPoll(p)) != null));
            }
            return taken;
        }

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

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


More information about the core-libs-dev mailing list