API for using poll/epoll instead of select

Adam Jackson ajax at nwnk.net
Thu May 26 18:52:34 UTC 2016

On Wed, 2016-05-25 at 22:44 -0700, Keith Packard wrote:

> It's similar to the NotifyFd interfaces added to the OS layer, but has
> the ability to support both level-triggered and edge-triggered
> notifications. Using edge-triggered notifications along with epoll
> reduces the notifications received from the kernel when the server is
> busy as only newly ready clients appear.

Exposing edge/level in ospoll_add is a bit funky, you're silently
degrading edge to level if the OS backend can't do edge. kqueue could do
it if the code were written, and I suspect win32's WaitForMultipleObjects
could be made to do it if we got really wild, but Solaris doesn't have an
edge-triggered API for this at all (does have port_create which is
basically level-triggered epoll, but).

If the intent is that asking for edge is an indication that the caller
_can_ use edge-triggers but will work with either then I guess that's
fine. A comment to that effect would be good.

- ajax

More information about the xorg-devel mailing list