[Python-Dev] epoll implementation

"Martin v. Löwis" martin at v.loewis.de
Fri May 26 22:12:15 CEST 2006


Ross Cohen wrote:
> True, and as I mentioned before, the python API more closely matches epoll
> in this case. The level-triggered mode of epoll is an almost perfect match.
> Someone went to some lengths to hide the details of the system poll
> interface.

Ah right, I missed that point. That makes it difficult to find an
application that would break :-) One problem is that epoll allocates
another file handle, when poll does not; the other problem could exist
when the EPOLL constants differ in value from the POLL constants (which
isn't the case on Linux), and then somebody uses numeric values instead
of symbolic ones for register().

That said, I would be in favour of having select.poll "silently" use
epoll where available. Of course, it would be good if a "cheap" run-time
test could be made whether epoll is available at run-time (although
just waiting for ENOSYS from epoll_create is probably cheap enough).
Also, it would be good if the application could find out it is using
epoll; for example, epollObject could expose a fileno member.

Regards,
Martin


More information about the Python-Dev mailing list