<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    On 10/09/2024 05:10, Danny Thomas wrote:<br>
    <blockquote type="cite" cite="mid:CAABjz13RLQRk+Tf-=QA7idM-VfLjFwF7FNaRVM3CXdYVZXcdbw@mail.gmail.com">
      
      <div dir="ltr">I've switched to foreign functions for the native
        calls, using the current CPU for external submissions, and a
        queuing threshold to decide when to select the least loaded
        pool. Significantly improved CPU utilization versus the default
        scheduler with a slight throughput bump:<br>
        <br>
        <a href="https://urldefense.com/v3/__https://github.com/DanielThomas/virtual-threads-cluster-aware/commit/c0e7b6141a84eb77e6848fa84014e7a98ddfc75b__;!!ACWV5N9M2RV99hQ!NYPwGwIo_GAtKLVsGpCxRAPgR40IvyvZFfG8b3prgbw7T9DAJqjaElA9yjBq1CaMR0Gef5W4FwxUK50Hxw$" moz-do-not-send="true">https://github.com/DanielThomas/virtual-threads-cluster-aware/commit/c0e7b6141a84eb77e6848fa84014e7a98ddfc75b</a><br>
        <br>
        I'll improve the benchmark to be lumpier with more submission
        pressure to make work stealing more of a factor, and then look
        at balancing with pollSubmission.</div>
      <br>
    </blockquote>
    <br>
    Good use of FFM.<br>
    <br>
    You probably know this already:
    ForkJoinPool::getQueuedSubmissionCount is a O(n) scan so will be
    interesting to see how this performs as a heuristic.<br>
    <br>
    Related is that ForkWorkWorkerThread has a method that tests two
    queues (local and "current source") as a cheap way to test if it
    could execute something immediately.  This is currently used by
    Exchanger and LinkedTransferQueue to influence whether to spin. 
    Doug Lea has been thinking about whether to expose. Your experiments
    may be case that could use it.<br>
    <br>
    -Alan<br>
  </body>
</html>