Message179207
> The fact that that the FDs are duped shouldn't change anything to the
> events reported: it works while the number of FDs is less than
> FD_SETSIZE (epoll_wait() maxevents argument).
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.
> I just used dup() to make it easier to test, but you'll probably get
> the same thing it your FDs were sockets connected to different
> endpoints.
This is the part I disagree with -- I think it makes all the difference. Please try making such a modification.
>> while True:
>> ready_writers = set(fd for fd, evt in
>> ep.poll(-1, MAXEVENTS) if fd != r)
>> if ready_writers.issubset(seen_writers):
>> break
>> seen_writers |= ready_writers
>
>Of course it does, since the returned FDs are a subset of all the
>ready file descriptors.
>
>The point is precisely that, when there are more FDs ready than
>maxevents, some FDs will never be reported.
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. |
|
Date |
User |
Action |
Args |
2013-01-06 19:20:15 | sbt | set | recipients:
+ sbt, pitrou, neologix |
2013-01-06 19:20:15 | sbt | set | messageid: <1357500015.18.0.808528305373.issue16873@psf.upfronthosting.co.za> |
2013-01-06 19:20:15 | sbt | link | issue16873 messages |
2013-01-06 19:20:14 | sbt | create | |
|