<div>Are you also considering multiple levels of priority?  In the reader / processor / writer case, I can think of several priorities the processor might want:</div>
<div> </div>
<div>1. Normal -- here is another buffer to write.</div>
<div>2. Medium -- the file read failed, stop with this file.</div>
<div>3. Medium#2 -- too much information too fast, please stop sending until further notice.</div>
<div>4. High -- The system is going down, pack up and get out of dodge</div>
<div> </div>
<div>I&#39;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&#39;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.</div>

<div> </div>
<div>This argues for a many-level approach, which might as well be an integer or short.</div>
<div> </div>
<div>Kevin</div>
<div> </div>
<div class="gmail_quote">On Mon, Jan 25, 2010 at 11:29 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="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="im">Michel Fortin wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Personally I&#39;d tend to just not define any priority and deal with<br>things in a FIFO manner to keep things simple. If you want to add<br>
complexity (priority), it should be justified by use cases. So which<br>use case do you have in mind for priority?<br></blockquote><br></div>Upon further thinking, I realized there&#39;s need for two orthogonal things:<br>
<br>1. Priority messages of any type. They&#39;ll be put to the front of the queue.<br><br>2. &quot;Must handle&quot; messages that unblock any call to receive(). They may or may not have priority. These may be derived from Exception.<br>
<br>It&#39;s never simple is it :o/.<br><font color="#888888"><br><br>Andrei</font> 
<div>
<div></div>
<div class="h5"><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>