RFR: JDK-8319662 ForkJoinPool trims worker threads too slowly [v3]

Andrey Turbanov aturbanov at openjdk.org
Wed Nov 22 08:10:09 UTC 2023


On Tue, 21 Nov 2023 17:12:39 GMT, Doug Lea <dl at openjdk.org> wrote:

>> This update cascades timeouts to trim subsequent workers after the first  keepAlive inactive period.
>
> Doug Lea has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
> 
>  - Merge branch 'openjdk:master' into JDK-8319662
>  - tweak cascades; reinstate an @Contended; resolve JDK-8319498
>  - Support cascading idle timeouts

src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java line 2149:

> 2147:                 deadline - System.currentTimeMillis() < TIMEOUT_SLOP) {
> 2148:                 long sp = w.stackPred & LMASK, c;
> 2149:                 if ((nextPhase & SMASK) == ((int)(c = ctl) & SMASK)  &&

Suggestion:

                if ((nextPhase & SMASK) == ((int)(c = ctl) & SMASK) &&

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16725#discussion_r1401649883


More information about the core-libs-dev mailing list