How to observe "temporarily expanding the parallelism of the scheduler"?

Cay Horstmann cay.horstmann at gmail.com
Tue May 13 16:40:14 UTC 2025


https://openjdk.org/jeps/444 states:

"However, some blocking operations in the JDK do not unmount the virtual thread, and thus block both its carrier and the underlying OS thread. This is because of limitations at either the OS level (e.g., many filesystem operations) or the JDK level (e.g., Object.wait()). The implementations of these blocking operations compensate for the capture of the OS thread by temporarily expanding the parallelism of the scheduler. Consequently, the number of platform threads in the scheduler's ForkJoinPool may temporarily exceed the number of available processors."

I tried to create such a situation, but was so far unsuccessful, with 10K virtual threads doing frequent file operations, in quite a few different ways. I always saw exactly 14 carrier threads in jconsole, which is the #cores on my machine. This was with Java 24 on Linux.

I'd be grateful for a tip on how to demo this behavior.

Cheers,

Cay

-- 

Cay S. Horstmann | https://horstmann.com



More information about the loom-dev mailing list