<br><br><div><span class="gmail_quote">On 8/3/07, <b class="gmail_sendername">mike clemow</b> <<a href="mailto:gelfmuse@gmail.com">gelfmuse@gmail.com</a>> 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'm having a bit of an "ah-ha!" moment here.</blockquote><div><br>Great! I'm having coffee here :¬).<br> </div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
It makes sense to<br>me when described like this. If I understand this process correctly,<br>data-sharing aside, this is functionally equivalent to using the<br>"chuck --loop" invocation to start the VM and sporking shreds with
<br>"chuck + <a href="http://this.ck">this.ck</a>" and "chuck + <a href="http://that.ck">that.ck</a>." Or is that more like<br>Machine.add()?</blockquote><div><br>Actually, Machine.add() and "chuck +" 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's different in that it shares the name-space of the parent. Also; if a shred sporks a new shred and then "dies" all it's sporked childeren will be "killed" too, shreds it has added using
Machine.add() won't die in that case. <br> </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. Can one pass<br>messages between shreds in the VM like in Erlang processes using this<br>information? 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 "id parameter" to it'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'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's name.
<br> </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 "Ah-ha!",<br>Kas.<br></div>