Problems solved by aio, epoll, libevent, boost: asio

Source: Internet
Author: User
Tags epoll

Over the past few days, I have been working on a large volume of data solutions for linux. I have continuously learned about aio, epoll, libevent, boost: asio. In the past, I only knew that they are both asynchronous and non-blocking, but what are the key points to solve the problem? Through these several days of in-depth understanding, I will summarize them:

Aio is the asynchronous IO implemented by the kernel after linux2.6, or it is the true asynchronous IO.

Epoll is a substitute for select linux and solves the restriction of selectfd_set. The performance is better than that of select. In mac
The alternative solution on the OS x platform is kqueue.

Libevent is a cross-platform asynchronous solution. It provides different asynchronous solutions based on different platforms and is implemented using the Reactor model.

Boost: asio is a cross-platform network and underlying I/O C ++ programming library that supports TCP, UDP, ICMP, and serial ports. ASIO supports synchronous and asynchronous read/write modes. Epoll is used for implementation and a large amount of signal processing is inserted. The Asio library does not need to be independent, but the dependency on boost: system during the test may need to compile some libraries in boost.

The network library implemented by muduo using the Reactor model only supports Linux
2.6.x concurrent non-blocking TCP network programming, not cross-platform, does not support udp and ipv6. In terms of throughput, muduo is 18% faster than libevent2. In terms of event processing efficiency, muduo and libevent2 are generally close, and muduo throughput is more than 15% higher than boost. asio. Performance is advantageous in solving big data throughput, but it is a problem in terms of platform and network protocol support.

ACE is also a classic network library, developed by the author of "C ++ network programming". The design is superb and supports a wide range of protocols, however, the Use complexity and learning complexity are high, and there has always been an evaluation of "I am a student, I am a dead user.

It should be noted that their positioning is different. aio and epoll mainly provide asynchronous solutions, not network support for network libraries, libevent only provides simple http support to solve IO problems. asio and muduo and ACE are also high-performance network libraries.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.