[External] : Re: Virtual threads and executor ?
forax at univ-mlv.fr
forax at univ-mlv.fr
Sat Nov 20 19:17:51 UTC 2021
----- Original Message -----
> From: "Alan Bateman" <Alan.Bateman at oracle.com>
> To: "Remi Forax" <forax at univ-mlv.fr>
> Cc: "loom-dev" <loom-dev at openjdk.java.net>
> Sent: Samedi 20 Novembre 2021 18:31:58
> Subject: Re: [External] : Re: Virtual threads and executor ?
> On 20/11/2021 12:26, forax at univ-mlv.fr wrote:
>> :
>> The problem with Executors.newVirtualThreadPerTaskExecutor() is that you can not
>> specify an underlying executor, all the virtual threads has to run on the
>> default common fork/join pool but the common F/J pool is not good in all use
>> cases (you can even specify another pool when using a parallel stream), it's
>> just a good default.
>>
>> I am all good with not having an API promising too much, but this limitation
>> makes the integration of loom to existing libraries/stack unnecessary hard IMO.
>>
> I suspect you know this but just to say that virtual thread doesn't use
> the common pool. The FJP instance for virtual threads is configured
> differently, the main difference is that it is configured in async mode
> (FIFO).
I've seen that when i read the source but i totally forgot about it.
The default F/J pool for the virtual thread is different from the common F/J pool,
thanks for the remainder.
>
> -Alan.
Rémi
More information about the loom-dev
mailing list