RFR: 8373118: Test java/lang/Thread/virtual/Starvation.java timed out [v5]
Alan Bateman
alanb at openjdk.org
Mon Dec 15 11:52:24 UTC 2025
On Mon, 15 Dec 2025 11:32:00 GMT, Viktor Klang <vklang at openjdk.org> wrote:
>> 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 1865:
>
>> 1863: long ac = (c + RC_UNIT) & RC_MASK, nc;
>> 1864: int sp = (int)c, i = sp & SMASK;
>> 1865: if ((short)(c >>> RC_SHIFT) >= pc)
>
> I'm wondering if it might make sense to re-read `parallelism` on each new loop, since if we have a parallelism resize *during this loop* we want to exit early?
>
>
> Suggestion:
>
> for (long c = ctl;;) {
> WorkQueue[] qs = queues;
> long ac = (c + RC_UNIT) & RC_MASK, nc;
> int sp = (int)c, i = sp & SMASK, pc;
> if ((short)(c >>> RC_SHIFT) >= (pc = parallelism))
Maybe but it should also be rare to adjust parallelism, and setParallelism changed recently to signal.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28797#discussion_r2619087486
More information about the core-libs-dev
mailing list