(sorry, ignore that -- accidentally bumped the send.)<br><br><div class="gmail_quote">On Wed, Jan 20, 2010 at 2:08 AM, Andrei Alexandrescu <span dir="ltr">&lt;<a href="mailto:andrei@erdani.com">andrei@erdani.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I&#39;m getting message from you that quote some other messages but have no other content.<br>

<br>
Andrei<br>
<br>
Kevin Bealer wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5">
On Wed, Jan 20, 2010 at 1:50 AM, Andrei Alexandrescu &lt;<a href="mailto:andrei@erdani.com" target="_blank">andrei@erdani.com</a> &lt;mailto:<a href="mailto:andrei@erdani.com" target="_blank">andrei@erdani.com</a>&gt;&gt; wrote:<br>

<br>
    Sean Kelly wrote:<br>
<br>
        void fnB() {<br>
           // do something that takes a while<br>
        }<br>
        void fnA() {<br>
           spawn( &amp;fnB );<br>
        }<br>
<br>
        void main() {<br>
           auto tid = spawn( &amp;fnA );<br>
           tid.wait();<br>
        }<br>
<br>
        The main thread doesn&#39;t know the thread running fnB exists so it<br>
        can&#39;t wait for it, even if it&#39;s doing completely legitimate work<br>
        and shouldn&#39;t be interrupted.  How can I trivially rewrite this<br>
        program so it completes without error?<br>
<br>
<br>
    If fnB does legitimate work and doesn&#39;t call concurrency-related<br>
    routines, it will be waited for.<br>
<br>
    If fnB does call concurrency-related routines, it must end when<br>
    main() exits. To me exiting main() is a no-quarters situation: it<br>
    means the application is to exit asap. I find it weird to think of<br>
    programs that finish main() but continue to do stuff.<br>
<br>
    To make sure everything is accounted for, the application design<br>
    must be such that main() doesn&#39;t exit until useful threads are done.<br>
<br>
<br>
    Andrei<br>
<br>
    _______________________________________________<br>
    dmd-concurrency mailing list<br></div></div>
    <a href="mailto:dmd-concurrency@puremagic.com" target="_blank">dmd-concurrency@puremagic.com</a> &lt;mailto:<a href="mailto:dmd-concurrency@puremagic.com" target="_blank">dmd-concurrency@puremagic.com</a>&gt;<div class="im">
<br>
    <a href="http://lists.puremagic.com/mailman/listinfo/dmd-concurrency" target="_blank">http://lists.puremagic.com/mailman/listinfo/dmd-concurrency</a><br>
<br>
<br>
<br></div>
------------------------------------------------------------------------<div class="im"><br>
<br>
_______________________________________________<br>
dmd-concurrency mailing list<br>
<a href="mailto:dmd-concurrency@puremagic.com" target="_blank">dmd-concurrency@puremagic.com</a><br>
<a href="http://lists.puremagic.com/mailman/listinfo/dmd-concurrency" target="_blank">http://lists.puremagic.com/mailman/listinfo/dmd-concurrency</a><br>
</div></blockquote><div><div></div><div class="h5">
_______________________________________________<br>
dmd-concurrency mailing list<br>
<a href="mailto:dmd-concurrency@puremagic.com" target="_blank">dmd-concurrency@puremagic.com</a><br>
<a href="http://lists.puremagic.com/mailman/listinfo/dmd-concurrency" target="_blank">http://lists.puremagic.com/mailman/listinfo/dmd-concurrency</a><br>
</div></div></blockquote></div><br>