RFR: 8349763: Expose more ForkJoinPool parameters to configure virtual thread scheduler
Alan Bateman
alanb at openjdk.org
Tue Feb 11 07:41:09 UTC 2025
On Tue, 11 Feb 2025 02:36:14 GMT, Jiawei Tang <jwtang at openjdk.org> wrote:
> Since the parameters `-Djdk.virtualThreadScheduler.parallelism=N` , `-Djdk.virtualThreadScheduler.maxPoolSize=M`, `-Djdk.virtualThreadScheduler.minimumRunnable=Y` have already been made available, it would be worth considering opening up additional ForkJoinPool-related parameters: `-Djdk.virtualThreadScheduler.corePoolSize=X`, `-Djdk.virtualThreadScheduler.keepAliveTime=Z` and `-Djdk.virtualThreadScheduler.timeUnit`.
>
> In particular, configuring corePoolSize can help reduce jitter caused by thread ramp-up during application startup, while keepAliveTime and timeUnit ensures more threads are available within the time expected by users. Opening these parameters would be highly meaningful for optimizing virtual thread scheduling.
I should have been clearer, I wasn't suggesting creating a PR against the loom repo. Instead I'm suggesting that you start a discussion on loom-dev with a summary of the issues that you are running into so they can be discussed and understood. It's too early to say if this is something that FJP should do better or whether additional configuration knobs need to be exposed. When we initially introduced this feature we decided to limit the number of configuration knobs to two system properties documented in an implNote of the Thread API.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/23549#issuecomment-2650028840
More information about the core-libs-dev
mailing list