<br><br><div class="gmail_quote">2008/6/13 mike clemow &lt;<a href="mailto:gelfmuse@gmail.com">gelfmuse@gmail.com</a>&gt;:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d"><br>
</div>Yes, I forgot to mention that! &nbsp;Crazy... &nbsp;I guess I&#39;ll manually<br>
unchuck the SinOsc for now. &nbsp;I&#39;ll have to check if that happens with<br>
other UGens...<br>
</blockquote><div><br>Unchucking unused Ugens it good form anyway. Wherever you can afford to I&#39;d do that because it saves CPU. IT tisn0/t alway appropriate because with some Ugens or systems of Ugens the code need not be aware of when the Ugen is &quot;done&quot;, for example with the physical models in the STK.<br>
&nbsp;<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Meanwhile, if I unchuck that SinOsc from the dac it works in the sense<br>
that the SinOsc objects don&#39;t add up, however, only if the shreds<br>
finish executing. &nbsp;If I remove the parent while one of the sporked<br>
shreds is still running, one sine keeps going. &nbsp;Ostensibly because the<br>
last shred hasn&#39;t finished and the unchuck line hasn&#39;t run. &nbsp;This<br>
makes me really wish I could define code that would be called when a<br>
shred exits. &nbsp;That would be a neat feature...<br>
</blockquote><div><br>Yes, quite weird and I can&#39;t remember this being like that in the past. This is truely arcane stuff and likely only Ge knows.... But I have a suspicion. Clearly a outside reference to a shred affects how it deals with cleanup. I suspect this has to do with Ge having been working at garbage collection (which also works with references... or at least will). I suspect what we are seeing might be a trace of the start of a GC framework. In that case we found a bug in a feature that&#39;s not even here yet... That would be quite funny.<br>
<br>Disclaimer; this is complete speculation and not of any practical use.<br><br>Code to be run when a shred exits is a interesting idea but I suspect it&#39;s asking for trouble. Because a shred has it&#39;s own namespace which is obviously gone when the shred is such code would probably need to be run *before* it exits and after it get&#39;s it&#39;s exit notice.... but then what if this code does stuff like advance time or (worse yet!) call for the exit of the same shred? I suspect this would be asking for stuck VM&#39;s and confused shredulers. I&#39;d rather have proper cleanup. I&#39;d also be quite interested in Shred type objects giving access to that shred&#39;s name-space like this;<br>
<br>fun void foo()<br>{<br>3 =&gt; int value;<br>while (second =&gt; now) &lt;&lt;&lt; value &gt;&gt;&gt;&gt;;<br>}<br></div></div><br>spork ~ foo() @=&gt; Shred bar;<br><br>4::second =&gt; now;<br><br>//modest proposal starts here<br>
5 =&gt; bar.value;<br>hour =&gt; now;<br><br>This would also enable us to run manual cleanup; either from the last lines of the shred&#39;s code (asuming it&#39;s not a infinite loop) or from the shred that calls for it&#39;s exit, right before the exit call. <br>
<br>Kas.<br>