[Development] epoll event dispatcher

Oswald Buddenhagen oswald.buddenhagen at digia.com
Thu Aug 8 17:46:05 CEST 2013


On Thu, Aug 08, 2013 at 08:18:18AM -0700, Thiago Macieira wrote:
> A poll-based dispatcher makes a lot of sense and I'd love to see it
> implemented.
> 
> An epoll-based one, however, I won't accept. I don't think it's
> needed, and worse I think it will add more overhead than a poll-based
> one. Even if we don't use timerfds and we stick to plain socket
> notifiers, Qt code turns socket notifiers on an off all the time. With
> epoll, we'll have to make syscalls for each activation or
> deactivation.
> 
that's actually a weird perspective.

epoll() perfectly fits the design of an object-oriented notifier
interface as we have. why does qt code toggle the notifiers so often?
would it be possible to rewrite it? would it be possible to optimize it
behind the scenes (e.g., propagate the toggling to the kernel only upon
entering the event loop)?

poll() otoh is a rather stupid interface. the only case where it is
better than select() is when you have *tons* of file descriptors open,
but are watching only very few in the upper range.



More information about the Development mailing list