select vs poll vs epoll [closed]

半世苍凉 提交于 2019-12-29 02:21:07

问题


I am designing a new server which needs to support thousands of UDP connections (somewhere around 100,000 sessions). Any input or suggestions on which one to use?


回答1:


The answer is epoll if you're using Linux, kqueue if you're using FreeBSD or Mac OS X, and i/o completion ports if you're on Windows.

Some additional things you'll (almost certainly) want to research are:

  • Load balancing techniques
  • Multi-threaded networking
  • Database architecture
  • Perfect hash tables

Additionally, it is important to note that UDP does not have "connections" as opposed to TCP. It would also be in your best interest to start small and scale larger since debugging network-based solutions can be challenging.




回答2:


The author of CURL wrote an amazing article on poll vs select vs event libraries.




回答3:


Linux: epoll FreeBSD: kqueue Windows: ??

There are wrapper libraries, such as libevent and libev, which can abstract this for you.



来源:https://stackoverflow.com/questions/4039832/select-vs-poll-vs-epoll

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