<br><br><div><span class="gmail_quote">On 31/01/2008, <b class="gmail_sendername">Renato Fabbri</b> &lt;<a href="mailto:renato.fabbri@gmail.com">renato.fabbri@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;">
hi Chuckers,</blockquote><div><br>Hello, Renato,<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;">I have two questions regarding the example bunddled with chuck in<br>
/examples/event/event_extend.ck (attached for convevience)<br><br>first, if the function hi is sporked four times, why does it run only<br>once? i mean, in each loop that takes one second i only see one<br>integer being printed. Anyway, i have removed 3 of the 4 spork<br>
statements and it seems to run just the same way.</blockquote><div><br>This is because the event is &quot;signalled&quot; and not &quot;broadcasted&quot;. In the case of signalling only the first shred on the event&#39;s waiting list is notified, when you broadcast a event *all* shreds waiting for it will wake up.<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;">second, why is the return type of hi specified as int when it doenst<br>return anything? I have exchaged the return type for void and it seems<br>
to run normally as well.</blockquote><div><br><br>I think that&#39;s just a plain error. You are right, it doesn&#39;t return a thing and I think that sporked functions *can&#39;t* return anything, the whole point of sporking is that the code doesn&#39;t wait for the function to finish so it couldn&#39;t return a thing. Well spotted.<br>
<br>Hope that helps,<br>Kas.<br></div><br></div>