[dmd-concurrency] priority messages
Andrei Alexandrescu
andrei at erdani.com
Mon Jan 25 09:32:53 PST 2010
Michel Fortin wrote:
> Le 2010-01-25 à 11:36, Kevin Bealer a écrit :
>
>> Are you also considering multiple levels of priority? In the
>> reader / processor / writer case, I can think of several priorities
>> the processor might want:
>>
>> 1. Normal -- here is another buffer to write. 2. Medium -- the file
>> read failed, stop with this file. 3. Medium#2 -- too much
>> information too fast, please stop sending until further notice. 4.
>> High -- The system is going down, pack up and get out of dodge
>>
>> I'm not sure if #2 and #3 need to be at different levels, but it
>> seems like 1, (2 or 3), and 4 should be distinct. E.g. you don't
>> care about either Medium if there is a High in the pipe and you
>> want to process Normals after any High or Medium is handled.
>>
>> This argues for a many-level approach, which might as well be an
>> integer or short.
>
> I think only one queue where you can put messages directly on the
> front is enough.
I'm with Michel. Arbitrary priorities are a natural extension, but I
don't want us to overengineer. Heck, I'd do without prioritySend if I
could get away with it.
Andrei
More information about the dmd-concurrency
mailing list