Atte;<br><br><div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">The current way chuck works makes sense. But (and I don't know &quot;the<br>
prober to do this in concurrent programming) I think it would make more<br>sense to wait for child shreds to finish before terminating. </blockquote><div><br><br>The problem with this is that childeren may very well be running forever. If a child is structured like this;
<br><br>while (true)<br>{<br>&lt;&lt;&lt;&quot;the world turns around&quot;&gt;&gt;&gt;;<br>1::year =&gt; now;<br>}<br><br>It's never going to finish (lucky world!). What you could do instead is go<br><br>int the_end;<br>
int child_done;<br><br>fun void child()<br>{<br>untill( the_end)<br>{<br></div>//do stuff here; potentially stuff that takes a while.<br>1::second =&gt; now;<br>}<br>//only do this after we fall out of the loop due to &quot;the_end&quot; becoming true.
<br>1 =&gt; child_done;<br>//at this point the child is going to leave the VM due to becoming &quot;unemployed&quot;<br>}<br><br>spork ~ child();<br><br>30::second =&gt; now;<br><br>1 =&gt; the_end;<br><br>untill ( child_done)
<br>{<br>//wait for the child to get done, could wait for multiple childeren if need be<br>5::ms =&gt; now;<br>}<br>//only exit now.<br>me.exit();<br><br><br>This should make the parent wait for the child to get done before exiting yet still alows the parent to kill it's childeren.
<br><br>The could be typos in the above but the general idea should be clear? Does that help?<br><br>Kas.</div>