RFR: 8319447: Improve performance of delayed task handling [v4]

Doug Lea dl at openjdk.org
Wed Feb 26 14:39:59 UTC 2025


On Wed, 26 Feb 2025 13:30:56 GMT, Viktor Klang <vklang at openjdk.org> wrote:

>> src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java line 3131:
>> 
>>> 3129:         if ((p = (cp = common).parallelism) < 2)
>>> 3130:             U.compareAndSetInt(cp, PARALLELISM, p, 2);
>>> 3131:         return cp;
>> 
>> Is this okay for deployments that run with java.util.concurrent.ForkJoinPool.common.parallelism set?
>
> @AlanBateman @DougLea Would it make sense to log something if this happens, or emit a JFR event, or somehow make people aware what occurred (and why)?

I don't think this would help anyone? We override in those existing situations in which threads would have been created anyway via the (now removed) bypass in CompletableFuture (also SubmissionPublisher). So anyone who used them with zero parallelism expecting no internal jdk thread creation will already have been surprised.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23702#discussion_r1971708639


More information about the core-libs-dev mailing list