Mac OS X 上的异步 I/O

发布于 2024-08-29 08:29:21 字数 372 浏览 2 评论 0原文

意思是C10K 问题,在 Mac OS X 上执行异步 I/O 的最佳方法是什么(假设在 Mac 和 iPhone/iPad 上使用)?

在 Linux 上我们选择是epoll,在 Windows 上我们选择I/O Completion Ports

最重要的是性能和可扩展性(数千个连接)。

更新

好的。由于Darwin是类BSD的系统,我的共同想法是使用kqueue。这是一个正确的方向吗?很高兴听到在该领域有经验的人的意见。

谢谢

Meaning the C10K problem, what is the best way to do asynch I/O on Mac OS X (assume to use on Mac and iPhone/iPad)?

On Linux our choice is epoll, on Windows is I/O Completion Ports.

Top priority is performance and scalability (thousands of connections).

UPDATE

OK. As Darwin is BSD-like system, my common idea is to use kqueue. Is this a right direction? It would be nice to hear from someone experienced in this area.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

时光礼记 2024-09-05 08:29:21

Boost.Asio 是一个优秀的交叉平台,高性能,C++ 网络库。在 Mac OS X 上,它使用 kqueue 作为反应器事件循环,其他平台使用 epoll、I/O 完成端口、poll 或 select。它可以毫无问题地扩展到数千个连接。顾名思义,它通过使用前摄器设计模式来实现并发而不使用线程,从而促进异步编程。

Boost.Asio is an excellent cross platform, high performance, C++ networking library. On Mac OS X it uses kqueue for the reactor event loop, other platforms use epoll, I/O completion ports, poll, or select. It can scale to thousands of connections without issues. As the name implies, it promotes asynchronous programming by using the proactor design pattern for concurrency without the use of threads.

尘曦 2024-09-05 08:29:21

如果你使用libev,你可以在各种兼容的异步IO后端(epoll、kqueue、select等)之间切换,而不必担心实现细节。

http://software.schmorp.de/pkg/libev.html

If you use libev, you can switch between a variety of compatible asynchronous IO backends (epoll, kqueue, select, etc...) without worrying about implementation details.

http://software.schmorp.de/pkg/libev.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文