Asyncio Queue implementation suggestion

Barry Scott barry at barrys-emacs.org
Fri Sep 18 12:15:03 EDT 2020



> On 17 Sep 2020, at 15:51, Dennis Lee Bieber <wlfraed at ix.netcom.com> wrote:
> 
> On Wed, 16 Sep 2020 13:39:51 -0400, Alberto Sentieri <22t at tripolho.com>
> declaimed the following:
> 
> 
>> devices tested simultaneously, I soon run out of file descriptor. Well, 
>> I increased the number of file descriptor in the application and then I 
>> started running into problems like “ValueError: filedescriptor out of 
>> range in select()”. I guess this problem is related to a package called 
> 
> 
> https://man7.org/linux/man-pages/man2/select.2.html
> """
> An fd_set is a fixed size buffer. 
> """
> and
> """
> On success, select() and pselect() return the number of file
>       descriptors contained in the three returned descriptor sets (that
> is,
>       the total number of bits that are set in readfds, writefds,
>       exceptfds).
> """
> Emphasis "number of bits that are set" -- the two together implies that
> these are words/longwords/quadwords used a bitmaps, one fd per bit, and
> hence inherently limited to only as many bits as the word-length supports.

The limit has nothing to do with word size. The bits are passed as unsigned char arrary.

Here is the piece expelling the limit:
 select() can monitor only file descriptors numbers that are less than
       FD_SETSIZE; poll(2) <https://man7.org/linux/man-pages/man2/poll.2.html> and epoll(7) <https://man7.org/linux/man-pages/man7/epoll.7.html> do not have this limitation.  See
       BUGS.
FD_SETSIZE is typically 1024.

Barry



More information about the Python-list mailing list