Charles-François Natali added the comment:
> That assumes that epoll_wait() is supposed to return *all* ready fds. But
> that is not possible because maxevents is finite. If you want all events
> then obviously you may need to call epoll_wait() multiple times.
Yes, but the problem is that between two epoll_wait() calls, the
readiness of the FDs can have changed: and if that happens, you'll get
the same list over and over.
> The program can only terminate when the outer
>
> while all_writers - seen_writers:
> ...
>
> loop terminates. So seen_writers == all_writers, and every fd has been
> reported.
Yes, but there are no event generated between calls to epoll_wait() in
your inner loop.
In a typical usage of select()/poll() epoll() will look like:
while True:
evts = poll()
for evt in evts:
do_something(fd)
and between two calls to poll(), you can get new events (new
connections, space in the socket buffer, etc). The pipe
filling/draining is used to generate new events. Your modification
doesn't take that into account.
> This is the part I disagree with -- I think it makes all the difference.
> Please try making such a modification.
Will do.
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue16873>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com