> On Apr 4, 2016, at 11:33 AM, Sterling Hughes <[email protected]> wrote:
> 
>> I don’t think the select() kind of mask is a good idea. eventq_XXX is more
>> like kqueue() rather than select(). I don’t think there are that many places
>> where you’d want to mask out some events and not others. Especially
>> as this’ll mean that there will presumably will mean that events will get
>> delivered out of order.
>> 
> 
> Would you prefer that eventq_poll() poll multiple eventq and return when an 
> event is available on one of them, or there is a timeout?   I can understand 
> wanting to preserve ordering on the queue, and things getting confusing if 
> app code isn't smart about this.
> 
> However, I think it is a fairly common access mechanism to want to grab only 
> certain events from a queue.  Imagine a case where you send a packet, and you 
> are waiting for a response, and you only want to pull events related to 
> response from the eventq, even if you have multiple events that can run 
> through that queue.  I see two options for handling this neatly:
> 
> 1- Have a mask, and only pull events off that queue which match the mask
> 2- Have eventq_poll() take multiple event queues, so that you can poll 
> multiple queues at once.
> 
> What do you think?
> 

Converting an array of integers to bit mask in the caller, and doing the reverse
in the callee is not too great.

Option 2 sounds much, much better.

Reply via email to