On Tue, 24 Nov 2026 13:58:03 GMT, Viktor Klang <[email protected]> wrote:

>> Doug Lea has updated the pull request with a new target base due to a merge 
>> or a rebase. The pull request now contains 211 commits:
>> 
>>  - Merge branch 'openjdk:master' into JDK-8373118
>>  - Refactor tryTerminate, regularlize constructions, rewrite design doc
>>  - Use adaptation of previous interference check; long base
>>  - restore lazySUbmit semantics
>>  - Repair clobbered line; other misc tunings
>>  - Revert lazySubmit; add non-public randomSubmit; other misc tunings
>>  - Merge branch 'openjdk:master' into JDK-8373118
>>  - Rondomize lazySubmit; balance costs across use cases
>>  - Merge branch 'openjdk:master' into JDK-8373118
>>  - Re-remove helpSignalWork
>>  - ... and 201 more: https://git.openjdk.org/jdk/compare/78bf06f4...cd9ab7ab
>
> src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java line 2777:
> 
>> 2775:                 WorkQueue w = new WorkQueue(null, id, 0, false);
>> 2776:                 long stop = lockRunState() & STOP;
>> 2777:                 if (stop == 0L && (qs = queues) != null && i < 
>> qs.length &&
> 
> @DougLea When we re-read `queues` here and that yields a separate instance 
> than `qs` was up until then, then `i` is likely wrong as `i` is based on the 
> previous `qs`:s length, so we should probably retry the loop if `qs != qs = 
> queues)` (or something like that). Or am I wrong? :)

@DougLea I think we really need to check `qs == (qs = queues)` here since we 
calculated `i` for what could be another `qs`. It should be enough to do that 
since we have the lock on runState on this line.

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

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

Reply via email to