Some generic questions about the virtual thread.
nadeesh t v
nadeeshtv at gmail.com
Wed Nov 13 16:17:41 UTC 2024
Thank you both for the clarification.
Thanks and Regards,
Nadeesh TV
On Wed, 13 Nov 2024 at 16:18, Alan Bateman <alan.bateman at oracle.com> wrote:
> On 10/11/2024 07:59, nadeesh t v wrote:
>
> :
>
>
> What is the reason behind making a virtual thread daemon thread?
>
> Does it mean we should use virtual thread only if we do not care about its
> completion before shutdown of JVM?
>
>
> Most virtual threads will be started in some container, maybe with
> thread-per-task executor, or maybe with structured task scope. So while the
> Thread API is tempting to use directly, it's more likely that frameworks or
> libraries start virtual threads in some container that supports close or
> some other means to wait for specific threads to terminate.
>
> Virtual threads don't interact with the shutdown sequence, e.g. 100k
> virtual threads blocked on sockets or channels, would you really want the
> shutdown sequence to wait?
>
>
>
> IN JEP 444, I could see `The scheduler does not compensate for pinning by
> expanding its parallelism.` Is it based on the assumption that other tasks
> may wait for the same lock or is it because of some other technical
> reasons around pinning?
>
>
> The Alternatives section in JEP 491 [1] says more about this, it's
> basically that the number of carriers is limited.
>
> -Alan
>
> [1] https://openjdk.org/jeps/491#Alternatives
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20241113/8cf86b5a/attachment.htm>
More information about the loom-dev
mailing list