[dmd-concurrency] draft 5

Kevin Bealer kevinbealer at gmail.com
Tue Jan 19 22:56:40 PST 2010


Sounds cool, can't wait to read it.

Kevin

On Wed, Jan 20, 2010 at 1:44 AM, Andrei Alexandrescu <andrei at erdani.com>wrote:

> Kevin Bealer wrote:
>
>  On Wed, Jan 20, 2010 at 1:28 AM, Andrei Alexandrescu <andrei at erdani.com<mailto:
>> andrei at erdani.com>> wrote:
>>
>>    That would certainly work, but honest to God I am completely
>>    infatuated with the proposed model. It's simple, no need for a new
>>    "daemon" concept, and avoids very easily and elegantly the
>>    unpleasant zombie situation when main has finished but is somewhere
>>    in limbo mode hoping for some other thread to end.
>>
>>    Also, look at how simple it makes all examples. It's a dream come
>>    true. I've been thinking of a correct shutdown protocol for years,
>>    and this is better than anything I've ever tried.
>>
>>    I'd be ok with doing what Java does if we find an Achilles' heel of
>>    the current model. If not, I suggest we go with it and let users
>>    handle their own daemons (heh) in main().
>>
>>
>>    Andrei
>>
>>
>> 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 'ownership of role'.)  I've been on a team that had to
>> invent such things ourselves.
>>
>
> I have good news. In the upcoming section "Out-of-Band Communication" I
> will clarify that Shutdown is but one instance of a general oob
> communication mechanism. The mechanism works like this:
>
> * If you pass a message Msg that inherits Exception and the receive() in
> the receiver *handles* Msg, then everything goes normally.
>
> * However, if the receive() call in the receiver does *not* handle Msg (or
> a base of it), then receive() throws the Msg object.
>
> 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.
>
> I can't believe exception mesh with this model so well. It's as if they
> were designed for this purpose.
>
>
> Andrei
>
>
> _______________________________________________
> dmd-concurrency mailing list
> dmd-concurrency at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/dmd-concurrency
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/dmd-concurrency/attachments/20100120/cc9fd355/attachment-0001.htm>


More information about the dmd-concurrency mailing list