API for using poll/epoll instead of select

Keith Packard keithp at keithp.com
Thu May 26 05:44:24 UTC 2016


I'm finishing up replacing select with either poll or epoll (or other)
and wanted to present the API I've constructed for this work.

The goal is to hide the implementation details away from the server so
that we can easily swap in OS-specific replacements. I've implemented
poll and epoll back ends, and also discovered that winsock2 has a
trivial replacment for poll called WSAPoll, so that should be covered as
well.

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.

The NotifyFd interfaces are now fairly simple wrappers around this new
interface.

All of this is on the 'epoll' branch of my X server repository.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ospoll.h
Type: text/x-chdr
Size: 4203 bytes
Desc: File descriptor monitoring interface
URL: <https://lists.x.org/archives/xorg-devel/attachments/20160525/e6be469b/attachment.h>
-------------- next part --------------

-- 
-keith
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 810 bytes
Desc: not available
URL: <https://lists.x.org/archives/xorg-devel/attachments/20160525/e6be469b/attachment.sig>


More information about the xorg-devel mailing list