RFR: 8360046: Scalability issue when submitting virtual threads with almost empty tasks [v5]

Viktor Klang vklang at openjdk.org
Wed Aug 13 09:05:17 UTC 2025


On Thu, 7 Aug 2025 14:03:40 GMT, Doug Lea <dl at openjdk.org> 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:
> 
>   Avoid underutilization on resize

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

> 1297:                 if (pool != null &&
> 1298:                     (a == null ||                // always signal on resize
> 1299:                      U.getReferenceAcquire(a, slotOffset(m & (s - 1))) == null))

@DougLea Interesting. Is the reason that it is cheaper to check `a` for null here that it elides a nullcheck in the getReferenceAcquire? (even if it adds the cost of nulling out `a` after growArray())

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26479#discussion_r2272612154


More information about the core-libs-dev mailing list