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

Doug Lea dl at openjdk.org
Mon Feb 9 21:30:53 UTC 2026


On Fri, 23 Jan 2026 13:10:49 GMT, Viktor Klang <vklang at openjdk.org> wrote:

>> 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 1303:
> 
>> 1301:                     U.putReferenceVolatile(this, ARRAY, newArray);
>> 1302:                     if (unlock != 1)
>> 1303:                         phase = unlock;
> 
> Not sure if it helps, but if we can piggyback on the volatile write to phase, then we could structure it like so:
> 
> 
>                     if (unlock != 1) {
>                         U.putReference(this, ARRAY, newArray);
>                         phase = unlock;
>                     } else {
>                         U.putReferenceVolatile(this, ARRAY, newArray);
>                     }

Good idea. Will do.

> src/java.base/share/classes/java/util/concurrent/ForkJoinTask.java line 643:
> 
>> 641:      */
>> 642:     public final ForkJoinTask<V> fork() {
>> 643:         Thread t; ForkJoinWorkerThread wt;
> 
> @DougLea Btw, we can likely remove noUserHelp and setNoUserHelp (and associated bits).

The bit is still needed in FJT awaitDone, and the method might be useful elsewhere even though it's no longer used with signalling because the other changes make it not worthwhile.

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

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


More information about the core-libs-dev mailing list