epoll VS选择 [英] epoll VS select

查看:113
本文介绍了epoll VS选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经阅读了几本网络书籍,以了解epoll和select之间的区别,但是它们仅涵盖了这一概念.如果你们能为我提供细节方面的关键差异,我将不胜感激.

I have read a couple of networking books to get some idea of differences between epoll and select but they only covered this concepts slightly. I will be appreciated if you guys can provide me the key differences in details.

预先感谢

推荐答案

select是用于执行异步IO的标准Unix工具.它的编程接口很古怪,在大多数Unix中,它的实现充其量只是中等水平.它还对进程可以监视的描述符的最大数量施加了限制,这在应用程序中很不方便.关于效率,select的性能通常随描述符的数量线性下降.

select is the standard Unix facility for doing asynchronous IO. Its programming interface is quirky, and its implementation in most Unixes is mediocre at best. It also imposes a limit on the maximum number of descriptors a process can watch, which is inconvenient in an application. Regarding efficiency, the performance of select usually degrades linearly with the number of descriptors.

epoll是对select的巨大改进,但仅在2.6版及更高版本的Linux中提供.其他Unix也有专门的调用.

epoll is a huge improvement over select in terms of programming interface and efficiency, but is only provided in Linux starting from version 2.6. Other Unixes have their specialised calls, too.

这篇关于epoll VS选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆