RFR: 8360046: Scalability issue when submitting virtual threads with almost empty tasks [v17]
Viktor Klang
vklang at openjdk.org
Mon Nov 24 16:17:04 UTC 2025
On Tue, 18 Nov 2025 22:27:46 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:
>
> Tweaks
src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java line 1261:
> 1259: if ((a = array) != null && (cap = a.length) > 0) { // else disabled
> 1260: int k = (m = cap - 1) & s;
> 1261: if ((room = m - (s - b)) >= 0) {
Not that I think it'd make much of a difference, but it would be possible to do the following:
Suggestion:
int k;
if ((room = (k = (m = cap - 1) & s) - (s - b)) >= 0) {
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26479#discussion_r2546508029
More information about the core-libs-dev
mailing list