RFR: 8360046: Scalability issue when submitting virtual threads with almost empty tasks [v5]

Doug Lea dl at openjdk.org
Mon Sep 15 12:09:17 UTC 2025


On Thu, 14 Aug 2025 11:41:33 GMT, Viktor Klang <vklang at 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/ForkJoinPool.java line 2072:
> 
>> 2070:                     p = awaitWork(w, p);      // block, drop, or exit
>> 2071:             }
>> 2072:         }
> 
> @DougLea if `w != null` is always expected to be `true`, it might make sense to throw some form of exception in case it actually is. Possibly an assertion?

Added some comments. I settled on the convention (mentioned in docs) of always exiting on any null for the sake of clean termination. Even when nulls are currently impossible, foe the sake of future changes.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26479#discussion_r2348786367


More information about the core-libs-dev mailing list