python select() is limited to fds < 64

Eric Blake eblake@redhat.com
Wed Mar 23 15:24:00 GMT 2011


On 03/23/2011 09:00 AM, Christopher Faylor wrote:
> On Wed, Mar 23, 2011 at 11:31:46AM +0000, Jon TURNEY wrote:
>> On 22/03/2011 20:08, Christopher Faylor wrote:
>>> On Tue, Mar 22, 2011 at 08:53:34PM +0100, V??clav Haisman wrote:
>>>> Jon TURNEY wrote, On 22.3.2011 20:29:
>>>>>
>>>>> python seems to be built with the default value of FD_SETSIZE, which is
>>>>> only 64 on cygwin.
>>>> Is this not because of the inherent limitation of
>>>> WaitForMultipleObjects() call?
>>>
>>> Yep.  Without a rewrite, it's a hard limit to Cygwin's select().
>>
>> Please read my email more closely.  I am not saying "python select() is
>> limited to waiting on 64 fds or less", I am saying "python select() is
>> limited to waiting on fd which are less than 64"
> 
> 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.

Which is why poll() was invented - it lets you wait on fds > 63
(however, you are still limited by WaitForMultipleObjects that nfds of
poll() must be <= 63).

-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://cygwin.com/pipermail/cygwin/attachments/20110323/9bc06301/attachment.sig>


More information about the Cygwin mailing list