<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 4/3/23 9:45 AM, Alan Bateman wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:4d8026a8-6e2c-ce52-8283-ab2ee1cd2cc2@oracle.com">
      
      On 03/04/2023 17:24, Babneet B Singh wrote:<br>
      <blockquote type="cite" cite="mid:MW5PR15MB5243105DC27F045E0B5C877FF7929@MW5PR15MB5243.namprd15.prod.outlook.com">
        <style type="text/css" style="display:none;">P {margin-top:0;margin-bottom:0;}</style>
        <div style="font-family: Calibri, Arial, Helvetica, sans-serif;
          font-size: 12pt; color: rgb(0, 0, 0); background-color:
          rgb(255, 255, 255);" class="elementToProof">
          <pre style="font-size: 12pt; background-color: rgb(255, 255, 255);" class="ContentPasted0 ContentPasted1">I would like to request clarification on how JVMTI resume and suspend work for a virtual thread and its associated carrier thread.<div>
</div><div class="ContentPasted1">Virtual thread runs on a carrier thread. Both are separate Java objects. JVMTI functions can be invoked separately on them. What is the relationship between the state of a virtual and carrier thread when JVMTI suspend and resume functions are invoked on them?</div></pre>
        </div>
      </blockquote>
      They are separate Thread objects for JVM TI too,.<br>
      <br>
      <br>
      <br>
      <blockquote type="cite" cite="mid:MW5PR15MB5243105DC27F045E0B5C877FF7929@MW5PR15MB5243.namprd15.prod.outlook.com">
        <div style="font-family: Calibri, Arial, Helvetica, sans-serif;
          font-size: 12pt; color: rgb(0, 0, 0); background-color:
          rgb(255, 255, 255);" class="elementToProof">
          <pre style="font-size: 12pt; background-color: rgb(255, 255, 255);" class="ContentPasted0 ContentPasted1"><div class="ContentPasted1">jvmti->SuspendThread(virtualThread) // Will this also suspend the carrier thread?</div></pre>
        </div>
      </blockquote>
      No, just the virtual thread. Remember the carrier is "blocked"
      when a virtual thread is mounted, it continues when the virtual
      thread unmounts. Once you get that mental model then most of the
      suspend/resume issues should be become straight forward to reason
      about.<br>
      <br>
    </blockquote>
    <p>It won't suspend the carrier thread, but the virtual thread
      remains mounted on the carrier thread, so the carrier thread
      continues to be blocked on the virtual thread, and can't be used
      to run other virtual threads.</p>
    <p><br>
    </p>
    <p>Chris<br>
    </p>
    <br>
  </body>
</html>