Busy Polling

Carl M java at rkive.org
Mon Mar 6 20:41:45 UTC 2023


> On 03/06/2023 1:08 AM PST Alan Bateman <alan.bateman at oracle.com> wrote:
> The system properties for overriding parallelism and the max pool size
> of the carrier threads are jdk.virtualThreadScheduler.parallelism and
> jdk.virtualThreadScheduler.maxPoolSize. They are documented the
> "Implementation Note" section of the Thread's class description and the JEP.

Ah, I had searched for "interrupt".  This helps.  

Given that there doesn't seem to be a way to pass a ManagedBlocker to the pool, should the maxPoolSize be the same as the parellelism?  AFAICT, the only way to increase the thread count beyond the parallelism is with MBs.

> 
> Off-hand, I don't know if there is a good recipe for configuring JMH +
> JDK to run a benchmark with a virtual thread. Such a setup might be
> useful for benchmark APIs or code that blocks a lot. I haven't seen JMH
> configuted with a custom executor so I assume what might be replacing
> platform threads with virtual threads and some/all of the first 8 are
> pinned so there is starvation. Maybe others that have explored this
> issue can reply, it might be worth checking the jmh-dev archives too in
> case this topic has been discussed already.
> 
> -Alan


More information about the loom-dev mailing list