Native methods and virtual threads
Brian S O'Neill
bronee at gmail.com
Fri Jul 14 19:46:25 UTC 2023
There's already precedent for supporting hints. A native call can be
tagged with an "isTrivial" hint, which can boost performance. If all
native calls temporarily boosted the thread pool size by default, the
trivial methods should be excluded.
On 2023-07-14 12:34 PM, Robert Engels wrote:
> Please do not add a hint or an api to address. The api methods that are
> VT friendly should be documented as such. I also think that any native
> call should +1 to the pool size for its duration. This will cover all
> cases. This is what Go does and it works well.
>
>> On Jul 14, 2023, at 1:26 PM, Alan Bateman <Alan.Bateman at oracle.com> wrote:
>>
>> On 14/07/2023 19:51, Alejandro Revilla wrote:
>>> :
>>>
>>> In relation to my initial proposition, I overlooked the
>>> jdk.virtualThreadScheduler.maxPoolSizeproperty, which could assist in
>>> my scenario. However, it seems to be capped at 256 unless parallelism
>>> is also set.
>>
>> The jdk.virtualThread.* system properties are documented in an
>> Implementation Note in the Thread class description.
>> jdk.virtualThread.maxPoolSize defaults to 256 but can be increased if
>> really needed.
>>
>> -Alan
More information about the loom-dev
mailing list