Busy Polling
Alan Bateman
Alan.Bateman at oracle.com
Tue Mar 7 07:46:37 UTC 2023
On 06/03/2023 20:41, Carl M wrote:
>> 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.
Some blocking operations can not, or do not, unmount the virtual thread.
In these cases, the blocking operations compensate by expanded
parallelism temporarily. So if you set maxPoolSize to parallelism then
it won't compensate. Under the hood, it does make use of the FJP.MB
mechanism, but not the MB API. There is a bit more on this topic in JEP 436.
-Alan
More information about the loom-dev
mailing list