<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
On 06/01/2023 09:42, Arnaud Masson wrote:<br>
<blockquote type="cite" cite="mid:BYAPR15MB2965891F7F6DAE5C343C803DC7FB9@BYAPR15MB2965.namprd15.prod.outlook.com">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style>@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:10.0pt;
font-family:"Calibri",sans-serif;}a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}div.WordSection1
{page:WordSection1;}</style>
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US" lang="EN-US">A long CPU-bound request (without any IO/yield)
on a vthread would virtually “pin” its native thread, which
is a thing we don’t generally want, no?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US" lang="EN-US">(A server can have both CPU-bound and IO-bound
requests at the same time.)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US" lang="EN-US">That would be a bit like blocking the even loop
on NodeJS:
<a href="https://nodejs.org/en/docs/guides/dont-block-the-event-loop/#blocking-the-event-loop-json-dos" moz-do-not-send="true" class="moz-txt-link-freetext">
https://nodejs.org/en/docs/guides/dont-block-the-event-loop/#blocking-the-event-loop-json-dos</a>
(mitigated by the fact there are more than 1 native thread
to run vthreads in general).<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US" lang="EN-US">Wouldn’t vthread preemptive scheduling fix
that?<o:p></o:p></span></p>
<br>
</div>
</blockquote>
Maybe but it needs a lot more real world usage of virtual threads to
see if this is really needed. As Ron mentioned, custom schedulers on
the list to re-visit and that may where the primitive to force
preempt is exposed and allow people to experiment with time sharing
if they want.<br>
<br>
-Alan<br>
</body>
</html>