On Sun, 7 Sep 2025 18:28:54 GMT, Doug Lea <[email protected]> wrote:
>> This set of updates reduces contention-based performance loss under heavy
>> over-subscription, while also improving perfomance more generally.
>
> Doug Lea has updated the pull request incrementally with one additional
> commit since the last revision:
>
> revive topLevelExec, adjust occrdingly; small teaks and copy-edits
src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java line 1224:
> 1222: if ((this.owner = owner) == null) {
> 1223: phase = id | IDLE;
> 1224: array = new ForkJoinTask<?>[INITIAL_QUEUE_CAPACITY];
Might be better to assign the array *before* assigning the phase as the latter
is a volatile write?
src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java line 1951:
> 1949: final void runWorker(WorkQueue w) {
> 1950: if (w != null) {
> 1951: int phase = w.phase;
Given that this is a volatile read, and presuming that the timing of this read
is important, perhaps add a comment on this line?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26479#discussion_r2340815858
PR Review Comment: https://git.openjdk.org/jdk/pull/26479#discussion_r2340822551