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 ou开发者_如何学Cr 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
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.
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
精彩评论