<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hi,</p>
    <p>this is a bit of a XY question. The actual problem is about
      managing clocks. Let's see if we can find a proper solution.<br>
    </p>
    <p>I would assume that you are storing the clock(s) alongside the
      interpreter instance. If you restart the interpret, unset the
      clock(s) with clock_unset(). If you free the instance, free the
      clock(s) with clock_free().</p>
    <p>If that somehow doesn't work for you, explain the exact problem
      and show the code.<br>
    </p>
    <p>---</p>
    <p>> It doesn't need to be unique across the world, just the
      local machine</p>
    <p>Why would your ID even need to be unique across the whole
      machine? I think it should be enough that it's unique within the
      app. In that case, you can simply use the memory address of the
      interpreter instance itself. In fact, that's how Pd creates the
      canvas and object IDs for communicating with the Tcl/Tk GUI app.</p>
    <p>Christof<br>
    </p>
    <div class="moz-cite-prefix">On 12.06.2021 18:50, Iain Duncan wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAN9NcLw7ufTbPZ+6u6zgMgo2pN66zFHvPJjt8_zfB6NAVXvTjw@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">Hi folks, i'm wrestling away with the schedule
        functions for Scheme-for-Pd, and I think I can make things a lot
        more reliable if I let every instantiation (or restart) of the
        scheme interpreter have a uid of some sort so that on a reset we
        can just ignore clocks running out on a previous instance
        instead of trying to clean them all up with manual memory
        management. (which approach is giving me segfaults because I'm
        screwing something up)
        <div><br>
        </div>
        <div>Can anyone tell me what a smart way of getting a unique
          identifier would be? It doesn't need to be unique across the
          world, just the local machine, so something that was seeded
          from system time would be fine. I'm not a Real C Programmer
          though, so am not clear what options will just work across all
          OS's, without needing to add dependencies.</div>
        <div><br>
        </div>
        <div>thanks!</div>
        <div><br>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Pd-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Pd-dev@lists.iem.at">Pd-dev@lists.iem.at</a>
<a class="moz-txt-link-freetext" href="https://lists.puredata.info/listinfo/pd-dev">https://lists.puredata.info/listinfo/pd-dev</a>
</pre>
    </blockquote>
  </body>
</html>