What are the underlying differences among select, epoll, kqueue, and evport?

冷暖自知 提交于 2019-12-03 16:27:28

In general, all Async I/O subsystems have different internals, but in current specific case these concrete async I/O libs are used to support as much platforms as possible. That is:

  • evport = Solaris 10
  • epoll = Linux
  • kqueue = OS X, FreeBSD
  • select = usually installed on all platforms as a fallback

Evport, Epoll, and KQueue have O(1) descriptor selection algorithm complexity, and they all use internal kernel space memory structures. Also they can serve lots (hundreds of thousands) file descriptors.

Apart the others, select can only serve up to 1024 descriptors, and does full scan of descriptors (so every time it iterates all descriptors to chose one to work with), so the complexity is O(n).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!