RFR: 8319447: Improve performance of delayed task handling [v2]
Doug Lea
dl at openjdk.org
Sat Feb 22 12:50:55 UTC 2025
On Fri, 21 Feb 2025 17:38: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:
>>
>> Address feedback
>
> src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java line 3526:
>
>> 3524: if (((ds = delayScheduler) == null &&
>> 3525: (ds = startDelayScheduler()) == null) ||
>> 3526: task == null || (runState & SHUTDOWN) != 0L)
>
> Might not make sense to start the delay scheduler if the task is null.
There's no longer need or value of that null check (there was in some trial version), so removed.
> src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java line 3557:
>
>> 3555: return scheduleDelayedTask(
>> 3556: new ScheduledForkJoinTask<Void>(
>> 3557: unit.toNanos(delay), 0L, false, command, null, this));
>
> Suggestion:
>
> unit.toNanos(delay), 0L, false, command, null, this)); // Implicit null-check of unit
done
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23702#discussion_r1966510207
PR Review Comment: https://git.openjdk.org/jdk/pull/23702#discussion_r1966509890
More information about the core-libs-dev
mailing list