[dmd-concurrency] priority messages

Michel Fortin michel.fortin at michelf.com
Mon Jan 25 08:38:38 PST 2010


Le 2010-01-25 à 11:20, Andrei Alexandrescu a écrit :

> Michel Fortin wrote:
>> Personally I'd tend to just not define any priority and deal with
>> things in a FIFO manner to keep things simple. If you want to add
>> complexity (priority), it should be justified by use cases. So which
>> use case do you have in mind for priority?
> 
> Thread termination! Also forcibly closing any protocol in progress. In an expanded file copy example that reads and writes several files, a read error should immediately send the signal to abort writes, even writes of buffers that are still waiting in the queue.

Ok, I see. Having priority seems a good solution for this use case. I like the "tid.prioritySend(message)" approach best.


-- 
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/





More information about the dmd-concurrency mailing list