[dmd-concurrency] Shutdown protocol
Michel Fortin
michel.fortin at michelf.com
Wed Jan 20 14:36:07 PST 2010
Le 2010-01-20 à 16:12, Robert Jacques a écrit :
>> But is it really a logic bug to keep a reference to the dispatcher in the worker thread? What if the worker thread could break its work in a few pieces it and dispatch them to other workers using the dispatcher?
>
> Yes and no. Yes, it is perfectly logical for a worker to keep the dispatcher's tid for the length of the job/task. Once all the work is done and the result sent back, there's no reason for the worker to keep the dispatcher's tid. And in a multi-dispatcher model, every reason it shouldn't.
There's a gray area between something being well-designed and something being a logic bug. I don't think the worker keeping a reference to the dispatcher should be seen as a bug. It's probably bad design, for the general case at least, but I'm sure it can makes sense in some specific cases.
--
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/
More information about the dmd-concurrency
mailing list