<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    On 20/02/2025 01:40, 唐佳未(佳未) wrote:<br>
    <blockquote type="cite" cite="mid:66156b8f-66f1-4c95-a4ec-72bc2b6ce5ae.tjw378335@alibaba-inc.com">
      
      <div class="__aliyun_email_body_block">
        <div style="font-family: Tahoma, Arial, STHeitiSC-Light, SimSun">
          <div style="clear: both;"><span style="font-family: Tahoma, Arial, STHeitiSC-Light, SimSun;">:<br>
            </span></div>
          <br>
          <div style="font-family: Tahoma, Arial, STHeitiSC-Light, SimSun;">
            <div style="clear: both;">
              <div class=" __aliyun_node_has_color __aliyun_node_has_bgcolor" style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: Consolas, 'Courier New', monospace; font-weight: 400; font-size: 14px; line-height: 19px; white-space: pre;"><div><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">java.util.concurrent.ForkJoinPool</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">@678ad349[Running, parallelism = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">8</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, size = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">8</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, active = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">7</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, running = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">0</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, steals = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">3931</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, tasks = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">0</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, submissions = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">1426</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">]</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">
java.util.concurrent.ForkJoinPool</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">@678ad349[Running, parallelism = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">8</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, size = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">8</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, active = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">8</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, running = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">0</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, steals = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">5908</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, tasks = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">0</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, submissions = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">48</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">]
</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">java.util.concurrent.ForkJoinPool</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">@678ad349[Running, parallelism = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">8</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, size = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">8</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, active = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">8</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, running = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">0</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, steals = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">7731</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, tasks = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">0</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, submissions = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">236</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">]</span></div><div><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">java.util.concurrent.ForkJoinPool</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">@678ad349[Running, parallelism = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">8</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, size = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">8</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, active = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">2</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, running = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">0</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, steals = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">10370</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, tasks = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">0</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, submissions = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">0</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">]</span></div>
</div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    Thanks for the jcmd output. It shows that there are no queued tasks
    in the worker queues (tasks = 0) but many tasks are in the external
    submission queues. Tasks for virtual threads are pushed to an
    external submission queue when a virtual thread is initially
    started, unparked by a platform thread, unblocked by another thread
    exiting a monitor that the virtual thread was blocked on, or awoken
    after sleep/timed-park.<br>
    <br>
    Your first mail speaks of a usage wth ThreadPoolExecutor and
    SynchronousQueue so I will guess there is some hand off from a
    platform thread to a virtual thread that would result in the task
    for the virtual thread being pushed to an external queue.<br>
    <br>
    Can you tell us a bit about the "run function"? I can't tell from
    the mails so far if this function is mostly compute bound or whether
    these virtual threads are blocking regularly to allow carriers be
    released to do other work. One of the mails mentions "tasks switched
    out but I wasn't sure how to read that.  Even without this then you
    are correct that the scheduling is not fair.<br>
    <br>
    -Alan<br>
    <br>
  </body>
</html>