[External] : Re: Virtual threads and executor ?

Alan Bateman Alan.Bateman at oracle.com
Sat Nov 20 17:31:58 UTC 2021


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).

-Alan.


More information about the loom-dev mailing list