<br><br><div><span class="gmail_quote">On 8/3/07, <b class="gmail_sendername">mike clemow</b> &lt;<a href="mailto:gelfmuse@gmail.com">gelfmuse@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Okay, I&#39;m having a bit of an &quot;ah-ha!&quot; moment here.</blockquote><div><br>Great! I&#39;m having coffee here :¬).<br>&nbsp;</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
&nbsp;&nbsp;It makes sense to<br>me when described like this.&nbsp;&nbsp;If I understand this process correctly,<br>data-sharing aside, this is functionally equivalent to using the<br>&quot;chuck --loop&quot; invocation to start the VM and sporking shreds with
<br>&quot;chuck + <a href="http://this.ck">this.ck</a>&quot; and &quot;chuck + <a href="http://that.ck">that.ck</a>.&quot;&nbsp;&nbsp;Or is that more like<br>Machine.add()?</blockquote><div><br>Actually, Machine.add() and &quot;chuck +&quot; are basically equivalent (aside from returning a Id in the .add() case). Sporking also results in new code being run in a new shred but it&#39;s different in that it shares the name-space of the parent. Also; if a shred sporks a new shred and then &quot;dies&quot; all it&#39;s sporked childeren will be &quot;killed&quot; too, shreds it has added using 
Machine.add() won&#39;t die in that case. <br>&nbsp;</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">According the manual, sporking a shred will return a reference to the
<br>shred, while using Machine.add() will return the ID.&nbsp;&nbsp;Can one pass<br>messages between shreds in the VM like in Erlang processes using this<br>information?&nbsp;&nbsp;Using a shared variables to store state information<br>might get kind of hairy in big programs.
</blockquote><div><br>Yes, you definately could. You could, for example use events, extended to have a id as a parameter and have sporked shreds listen for that event, then compare that &quot;id parameter&quot; to it&#39;s own.
<br><br>I sugest you read the manual section on events, events are cool; quite simple, very powerfull and they can be extended.<br><br>If that&#39;s not enough you might need to look into classes. Classes can also spork their own shreds upon construction and in that case you can use the class instance&#39;s name.
<br>&nbsp;</div><br>I hope that answers your question, if you are after something more specific we can look into that as well.<br><br><br>Happy to have been able to contribute to your &quot;Ah-ha!&quot;,<br>Kas.<br></div>