If I create an executor service of virtual threads
Executors.newVirtualThreadPerTaskExecutor()
I understand that each tasks is run over a virtual thread. These virtual threads are scheduled (hopefully interleaved) over platform threads.
How many platform threads are used here? I don't see any other API to specify the number of threads I want. I am running it on Macbook M1 Pro with Java 21.
There is no API to specify the number of threads used for virtual threads, but the documentation of
Thread
tells you how you change that numbers through system properties: