On 4/4/16 10:50 AM, marko kiiskila wrote:
Hi,

You get the timeout functionality by adding an timeout event on your own
to get the same functionality. Would not be a big burden.

However, this kind of convenience function should be ok. You could
even have that guy implement it this way, as opposed to adding additional
code to eventq_get() itself.


Yeah, I think many people want to use this.

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?

Sterling

Reply via email to