On Wed, 25 Mar 2026 21:49:11 GMT, Doug Lea <[email protected]> wrote:

>> Changes signal filtering to avoid possible starvation
>
> Doug Lea has updated the pull request with a new target base due to a merge 
> or a rebase. The pull request now contains 80 commits:
> 
>  - Merge branch 'openjdk:master' into JDK-8373118
>  - Merge branch 'openjdk:master' into JDK-8373118
>  - Fix DelayScheduler quiescent shutdown; misc tweaks
>  - Merge remote-tracking branch 'refs/remotes/origin/JDK-8373118' into 
> JDK-8373118
>  - Merge branch 'openjdk:master' into JDK-8373118
>  - Merge branch 'openjdk:master' into JDK-8373118
>  - Initial version of delegated lock redesign
>  - reenable submissionQueue bypass
>  - Improve performance under oversubscription, step 1
>  - Reduce reliance on noUserHelp
>  - ... and 70 more: https://git.openjdk.org/jdk/compare/88bdbb78...f2842dcd

src/java.base/share/classes/java/util/concurrent/DelayScheduler.java line 193:

> 191:         outer: for (long triggerTime = Long.MIN_VALUE;;) {
> 192:             Thread.interrupted();                 // clear status
> 193:             long d = (triggerTime == Long.MAX_VALUE) ? 0L : triggerTime 
> - now();

This will always go to the else-branch on the first run of the loop, might be 
"cheaper" to initialize `d` to Long.MIN_VALUE - now() in the 
for-loop-initializer and then recalculate it after `process()`?

src/java.base/share/classes/java/util/concurrent/DelayScheduler.java line 194:

> 192:             Thread.interrupted();                 // clear status
> 193:             long d = (triggerTime == Long.MAX_VALUE) ? 0L : triggerTime 
> - now();
> 194:             triggerTime = Long.MIN_VALUE;

Is the intent setting this to MIN_VALUE that if process() throws then the 
finally-block breaks? If so, it might be better to move the write to just 
before the call to `process()` and add a comment to indicate this.

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

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

Reply via email to