<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>For a completely different solution: you could write an external
      which pins the current thread to a specific core with a message.
      Then you just have an instance of [threadpin] in each (sub)process
      and set the desired core via a startup message like 'pd -send
      ";cpu 1"'.</p>
    <p>On the other hand, this could actually be a new startup flag for
      Pd, e.g. "pd -cpu 1".<br>
    </p>
    <p>Christof<br>
    </p>
    <div class="moz-cite-prefix">On 20.03.2020 18:26, Csaba Láng wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CABF=eXD-2urNOudaxn-L8GXmaB-a86K1US4hXEFVVnCS=1KYBQ@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">Chuck,
        <div><br>
        </div>
        <div>naturally i use [shell]. Your advice sounds like the
          ultimate solution.</div>
        <div>Now the same I have to make for the rest of the cores to
          keep the main Pd out of the core where the subprocess is
          bound.</div>
        <div><br>
        </div>
        <div>Thanks a lot,</div>
        <div><br>
        </div>
        <div>Popesz</div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Fri, Mar 20, 2020 at 6:03
          PM Charles Z Henry <<a href="mailto:czhenry@gmail.com"
            moz-do-not-send="true">czhenry@gmail.com</a>> wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0px 0px 0px
          0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi
          Popesz,<br>
          <br>
          Are you using [ggee/shell] ?<br>
          <br>
          Here's an example that works on my linux machine<br>
          <br>
          [taskset -c 2 $_ -noaudio >/dev/null & P=$! &&
          echo $P  && wait $P(<br>
          |<br>
          [ggee/shell]<br>
          |<br>
          [f ]    ///the PID<br>
          <br>
          When I run that command, $_ is a bash variable (see [env( -
          [shell] -<br>
          [print] for full environment) that has the full path to the pd
          binary<br>
          in use.  You may have to replace "$_" with something more
          appropriate<br>
          to your system<br>
          I added -noaudio, because my first pd process is handling
          audio I/O.<br>
          I don't need stdout from pd itself, so I added
          ">/dev/null".  The<br>
          process shows up in top or htop with those arguments
          included.  You<br>
          could distinguish between your processes by some environment
          variable<br>
          or set of options to pd in the command.<br>
          "& P=$! " launches pd into the background and records a
          variable P for<br>
          its PID.  There may be other ways of doing this.<br>
          "&& echo $P && wait $P"  causes the shell
          started by [shell] to output<br>
          the PID to stdout (the left outlet).  Without "wait $P",
          [shell]<br>
          outputs a bang from its right outlet immediately.  Using "wait
          $P"<br>
          allows [shell] to maintain the status of the process, and it
          outputs a<br>
          bang when the process ends.<br>
          <br>
          Using htop, I see that the process starts and runs on CPU "3".<br>
          Taskset must use a CPU numbering that starts at 0, and htop
          counts<br>
          CPU's from 1.<br>
          <br>
          Chuck<br>
          <br>
          <br>
          <br>
          On Fri, Mar 20, 2020 at 10:23 AM Csaba Láng <<a
            href="mailto:langcsaba@gmail.com" target="_blank"
            moz-do-not-send="true">langcsaba@gmail.com</a>> wrote:<br>
          ><br>
          > Dear list,<br>
          > I am getting closer to the solution of binding process to
          a certain core with taskset.<br>
          > e.g. taskset 0xa gedit will bind the gedit to the tenth
          core.<br>
          ><br>
          > Now the problem is that I cannot identify the subprocess
          by its name as it will be pd too, and the PID will be always
          different so cannot use that number too.<br>
          > What would be the logical solution for starting the
          subprocess from pd with the taskedit command?<br>
          ><br>
          > Thanks in advance for any help,<br>
          ><br>
          > Popesz<br>
          ><br>
          > On Thu, Mar 5, 2020 at 11:14 PM IOhannes m zmölnig <<a
            href="mailto:zmoelnig@iem.at" target="_blank"
            moz-do-not-send="true">zmoelnig@iem.at</a>> wrote:<br>
          >><br>
          >> On 3/5/20 10:48 PM, Charles Z Henry wrote:<br>
          >> > On Thu, Mar 5, 2020 at 4:14 AM Max <<a
            href="mailto:abonnements@revolwear.com" target="_blank"
            moz-do-not-send="true">abonnements@revolwear.com</a>>
          wrote:<br>
          >> >><br>
          >> >> A glance at the System Monitor CPU history
          graph should give you an idea.<br>
          >> >><br>
          >><br>
          >> i usually use 'htop', which is a much improved
          version of top which also<br>
          >> (among verious other interesting things) gives you
          the CPU of a process.<br>
          >><br>
          >> ><br>
          >> > Second, you can bind processes to certain CPUs. 
          This is called "CPU<br>
          >> > affinity" and it's controlled by the linux
          command "taskset".  This<br>
          >> > looks like a fine explanation<br>
          >><br>
          >><br>
          >> but keep in mind that the people who designed the
          muticore scheduling<br>
          >> algorithms most likely will have a better idea of how
          to ideally<br>
          >> distribute multiple processes onto multiple CPUs.<br>
          >><br>
          >> gmsdr<br>
          >> IOhannes<br>
          >><br>
          >> _______________________________________________<br>
          >> <a href="mailto:Pd-list@lists.iem.at"
            target="_blank" moz-do-not-send="true">Pd-list@lists.iem.at</a>
          mailing list<br>
          >> UNSUBSCRIBE and account-management -> <a
            href="https://lists.puredata.info/listinfo/pd-list"
            rel="noreferrer" target="_blank" moz-do-not-send="true">https://lists.puredata.info/listinfo/pd-list</a><br>
          ><br>
          > _______________________________________________<br>
          > <a href="mailto:Pd-list@lists.iem.at" target="_blank"
            moz-do-not-send="true">Pd-list@lists.iem.at</a> mailing list<br>
          > UNSUBSCRIBE and account-management -> <a
            href="https://lists.puredata.info/listinfo/pd-list"
            rel="noreferrer" target="_blank" moz-do-not-send="true">https://lists.puredata.info/listinfo/pd-list</a><br>
        </blockquote>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
<a class="moz-txt-link-abbreviated" href="mailto:Pd-list@lists.iem.at">Pd-list@lists.iem.at</a> mailing list
UNSUBSCRIBE and account-management -> <a class="moz-txt-link-freetext" href="https://lists.puredata.info/listinfo/pd-list">https://lists.puredata.info/listinfo/pd-list</a>
</pre>
    </blockquote>
  </body>
</html>