Asynchronous I / O on Mac OS X

The value is a C10K problem , which is best suited for asynchronous I / O on Mac OS X (suppose you're using it on a Mac and iPhone / iPad)?

On Linux, our choice is epoll; on Windows, I / O completion ports.

The top priority is performance and scalability (thousands of connections).

UPDATE

OK Since Darwin is a BSD-like system, my general idea is to use kqueue. Is it correct? It would be nice to hear from someone who was experienced in this field.

thanks

+4
source share
2 answers

Boost.Asio is an excellent cross-platform, high-performance C ++ network library. On Mac OS X, it uses kqueue to loop events in the reactor; other platforms use epoll, I / O completion ports, polling, or selection. It can scale to thousands of connections without problems. As the name implies, it promotes asynchronous programming using a proactor design pattern for concurrency without using threads.

+3
source

If you use libev, you can switch between different compatible asynchronous IO servers (epoll, kqueue, select, etc.) without worrying about implementation details.

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

+1
source

Source: https://habr.com/ru/post/1307435/


All Articles