RFR: 8322732: ForkJoinPool may underutilize cores in async mode [v17]

Viktor Klang vklang at openjdk.org
Fri May 31 14:11:05 UTC 2024


On Fri, 31 May 2024 13:18:33 GMT, Doug Lea <dl at openjdk.org> wrote:

>> This set of changes address causes of poor utilization with small numbers of cores due to overly aggressive contention avoidance. A number of further adjustments were needed to still avoid most contention effects in deployments with large numbers of cores
>
> Doug Lea has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Reconcile changes

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

> 2073:             }
> 2074:             if (p != phase &&                    // check quiescent termination
> 2075:                 ((runState & SHUTDOWN) == 0L || quiescent() <= 0)) {

@DougLea `runState` is a volatile, so this change implies a slight difference in memory effects from the `qc` check, I presume this is intentional? 🤔

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19131#discussion_r1622482495


More information about the core-libs-dev mailing list