how many file descriptors can select() manage in python socket?

前端 未结 1 721
独厮守ぢ
独厮守ぢ 2021-01-24 18:59

when my multithread program run, a error thrown. I guess select() to have to manage file descriptor too much ,but not sure. Someone can explain to me. Thank you so much.

相关标签:
1条回答
  • 2021-01-24 19:37

    The problem is that select() usually has built-in limit on filedescriptors it can manage (1024 on most systems). Try poll or epoll, that might help.

    Also note that select() uses unefficient algorithm to manage filedescriptors lookup. This algorithm has O(n) computational complecity, whilt epoll has O(1).

    0 讨论(0)
提交回复
热议问题