On Thu, 14 Aug 2025 11:27:10 GMT, Viktor Klang <vkl...@openjdk.org> wrote:
>> Doug Lea has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Avoid underutilization on resize > > src/java.base/share/classes/java/util/concurrent/Exchanger.java line 380: > >> 378: >> (!ForkJoinWorkerThread.hasKnownQueuedWork()))) { >> 379: for (int j = SPINS; p.match == null && j > >> 0; --j) >> 380: Thread.onSpinWait(); > > It might not be worth it, but I wonder if something like this would make a > positive impact: > > Suggestion: > > if (!(tryCancel = (deadline != 0L && > (ns = deadline - System.nanoTime()) <= 0L) || > Thread.currentThread().isInterrupted())) > && ncpu > 1 && > (i != 0 || /* check for busy VTs */ > (!ForkJoinWorkerThread.hasKnownQueuedWork()))) { > for (int j = SPINS; p.match == null && j > 0; --j) > Thread.onSpinWait(); (No longer applicable -- moved to different PR) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26479#discussion_r2348828552