This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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?

Thanks,
Bert




--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]