Sounds cool, can&#39;t wait to read it.<br><br>Kevin<br><br><div class="gmail_quote">On Wed, Jan 20, 2010 at 1:44 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;">Kevin Bealer wrote:<div class="im"><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Wed, Jan 20, 2010 at 1:28 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>
    That would certainly work, but honest to God I am completely<br>
    infatuated with the proposed model. It&#39;s simple, no need for a new<br>
    &quot;daemon&quot; concept, and avoids very easily and elegantly the<br>
    unpleasant zombie situation when main has finished but is somewhere<br>
    in limbo mode hoping for some other thread to end.<br>
<br>
    Also, look at how simple it makes all examples. It&#39;s a dream come<br>
    true. I&#39;ve been thinking of a correct shutdown protocol for years,<br>
    and this is better than anything I&#39;ve ever tried.<br>
<br>
    I&#39;d be ok with doing what Java does if we find an Achilles&#39; heel of<br>
    the current model. If not, I suggest we go with it and let users<br>
    handle their own daemons (heh) in main().<br>
<br>
<br>
    Andrei<br>
<br>
<br>
I really like the exception concept, by the way.  But I still think that if there is no way to send normal messages once the shutdown phase begins, you will see a small crop of schemes for sending messages in some other way to coordinate shutdown.  (Moreso on network based systems which tend to have sharper division of &#39;ownership of role&#39;.)  I&#39;ve been on a team that had to invent such things ourselves.<br>

</blockquote>
<br></div>
I have good news. In the upcoming section &quot;Out-of-Band Communication&quot; I will clarify that Shutdown is but one instance of a general oob communication mechanism. The mechanism works like this:<br>
<br>
* If you pass a message Msg that inherits Exception and the receive() in the receiver *handles* Msg, then everything goes normally.<br>
<br>
* However, if the receive() call in the receiver does *not* handle Msg (or a base of it), then receive() throws the Msg object.<br>
<br>
In other words, Exception-derived objects establish an out-of-band, priority communication system. If you want to make sure your message will be received, you know what to do.<br>
<br>
I can&#39;t believe exception mesh with this model so well. It&#39;s as if they were designed for this purpose.<br><font color="#888888">
<br>
<br>
Andrei</font><div><div></div><div class="h5"><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></div></blockquote></div><br>