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

Doug Lea dl at openjdk.org
Mon Sep 22 12:20:39 UTC 2025


On Mon, 22 Sep 2025 11:01:42 GMT, Viktor Klang <vklang at openjdk.org> wrote:

>> Doug Lea has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Add @Contended WorkQueue region. Adapt accordingly.
>
> src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java line 2118:
> 
>> 2116:     private int tryTrim(WorkQueue w, int activePhase, long deadline) {
>> 2117:         long c, nc; int stat, vp, i; WorkQueue[] vs; WorkQueue v;
>> 2118:         long waitTime = deadline - System.currentTimeMillis();
> 
> Why hoist this line from the branch? 🤔

It makes the no-longer-eligible check a teeny bit more accurate.

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

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


More information about the core-libs-dev mailing list