most of the reactor patterns used in high-performance network libraries under Linux are implemented, and the Boost ASIO uses Epoll and select to simulate Proactor mode under Linux, which affects its efficiency and complexity .
look at the performance of Aboutspeaker's own Linux Reactor network library and ASIO, which is about 1/5 higher than ASIO performance (throughput). Since the network library under Linux has a high reactor performance, why boost ASIO Do you want to use the simulated Proactor mode for Linux?
or why is ASIO not in win and Linux in reactor mode? Is this a better choice for performance? And more adaptable to the market? server-side after all, a lot of Linux.
it is difficult to achieve efficient and scalable Reactor under Windows. First, the Win32 API waitformultipleobjects can only wait for 64 handle (maximum_wait_objects) at the same time, and then the Select () of WinSock is buggy, especially in the error handling party. There are many wonderful behaviors on the surface (see comments on this in the various cross-platform network library code); Finally, the new Wsapoll () function in Windows Vista is not compatible with POSIX poll ().
Windows has its own set of highly efficient asynchronous IO models (almost equivalent to proactor), while supporting file IO and network IO, but Linux has only efficient network sync IO (IO multiplexing such as epoll are synchronous reactor, And does not support disk files), the efficient IO programming model is fundamentally incompatible (Windows can send network events to the event queue of the GUI thread, somewhat similar to Reactor, but it seems that a process can have only one GUI thread, so its scalability is limited on multicore systems).
therefore, to be efficient and cross-platform, ASIO can only use the Proactor model. Inevitably, it loses a bit of efficiency on Linux.
Why does boost ASIO need to be implemented with Proactor mode?