This is the mail archive of the
mailing list for the Cygwin project.
Re: python select() is limited to fds < 64
- From: "Bert Belder" <bertbelder at gmail dot com>
- To: <cygwin at cygwin dot com>
- Date: Wed, 20 Apr 2011 18:50:40 +0200
- Subject: Re: python select() is limited to fds < 64
Christopher Faylor wrote:
> I forgot to add one bit of data. Unless you go out of your way to
> change it, Cygwin's select can't wait for an fd > 63. It's basically a
> bit mask. So, there are two limitations: 1) the number of handles that
> you can wait for with WaitForMultipleObjects() and 2) the size of
> Cygwin's fd_set.
I have trouble believing this for two reasons:
1. I use node.js on Cygwin, and there seem to be no problems waiting for
readiness of a large (>1000) number of sockets. By default node uses poll()
which calls cygwin_select under the hood, but even when I force it to use
select() directly everything works ok.
2. Inspecting src/winsup/cygwin/select.cc, it looks like Cygwin distributes
the sockets (and other selectable stuff) that it is interested in over
different threads and uses WaitForMultipleObjects in those threads. Then in
the main thread it uses another WaiForMultipleObjects call to synchronize
between those threads. As different interests (read/write/error) and
different fd types require their own thread the fd limit must be somewhere
between a few hundred and 4032 (=64*63).
What did I miss?
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple