<div dir="auto"><br clear="all">Thank you both for the clarification.<br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div>Thanks and Regards,<br>Nadeesh TV<br></div><br></div><br></div></div></div></div><div><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 13 Nov 2024 at 16:18, Alan Bateman <<a href="mailto:alan.bateman@oracle.com">alan.bateman@oracle.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>
<div>
On 10/11/2024 07:59, nadeesh t v wrote:<br>
<blockquote type="cite">
<div dir="ltr">
<div>
<p style="margin:0px;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal">:</p>
<p style="margin:0px;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;min-height:15px"><br>
</p>
<p style="margin:0px;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal">What
is the reason behind making a virtual thread daemon
thread? </p>
<p style="margin:0px;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal">Does
it mean we should use virtual thread only if we do not care
about its completion before shutdown of JVM?</p>
</div>
</div>
</blockquote>
<br>
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.<br>
<br>
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?<br>
<br>
<br>
<blockquote type="cite">
<div dir="ltr">
<div>
<p style="margin:0px;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;min-height:15px"><br>
</p>
<p style="margin:0px;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal">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?</p>
</div>
</div>
</blockquote>
<br>
The Alternatives section in JEP 491 [1] says more about this, it's
basically that the number of carriers is limited. <br>
<br>
-Alan<br>
<br>
[1] <a href="https://openjdk.org/jeps/491#Alternatives" target="_blank">https://openjdk.org/jeps/491#Alternatives</a><br>
</div>
</blockquote></div></div>