select vs poll vs epoll
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?
CURL的作者写了一篇关于民意调查vs选择vs事件库的精彩文章。
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:
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.
Linux: epoll
FreeBSD: kqueue
Windows: ??
There are wrapper libraries, such as libevent and libev, which can abstract this for you.
链接地址: http://www.djcxy.com/p/61336.html上一篇: 我怎样才能打印这个堆栈中的值?
下一篇: 选择vs轮询vs epoll