Summary of various Io Models

Source: Internet
Author: User
Tags posix

We know that the AIO model library in boost is implemented using epoll. Please refer to the following discussion! This article introduces the efficiency of almost all development models!

1:
Epoll! = AIO
I just said that the boost network library is implemented by epoll in Linux.

The ACE contains ace_posix_aiocb_proactor and ace_dev_poll_reactor, which are implemented using AIO and epoll respectively. This is two different things.

2:
AIO = asynchronous I/O refers to an I/O processing mode, which has different implementation methods in different systems, the iocp of Win2k and epoll of Linux are all programming models that implement AIO, and some libraries directly use AIO as their names, which need to be differentiated, otherwise, if AIO refers to different things, it cannot be communicated.

3:
Ace_posix_aiocb_proactor is a similar port implementation in Linux.
The ace_dev_poll_reactor uses epoll, which is similar to the select mode, but returns all the excitation handles.

What I want to ask is which of the two things is more efficient in Linux?

The following are the materials found on the Internet. Is it true that epoll is the most efficient in Linux, and posix aio is not very good?

Blocking Mode
The most basic

Select
Should be the most basic
Too many handles are not supported.
Windows cannot contain more than 64

Poll
Or the most basic
It's better than select.

/Sys/poll
In Linux, the implementation of poll is basically enhanced.
There are also Sun OS, I don't know how

/Sys/epoll
The most efficient model on Linux, not supported in earlier kernel versions

AIO
POSIX standard, different implementations

Rtsig
It is also an I/O model on Linux, and the efficiency is similar to epoll.

Kqueue
FreeBSD's Io model is easy to use and efficient

Asyncselect
An I/O model in windows. For socket, I/O events are notified to users through windows message, which is more suitable for client software.

Eventselect
Similar to the above, it is only notified through the Event System Object. Because XP has no connectex before, there is no acceptex on Win9x.
This method must be used to process asynchronous socket connections for backward compatible systems.

Overlapped
I/O model on Windows.
I/O completed port is recommended in NT systems.
On 9x, you can use Event Notification or APC queue to receive notifications.

4:
I understand that AIO is just an interface standard. Each platform has its own implementation.
Just as various compilers of STL have their own implementations. Therefore, your question is of little significance.

5:
Posix aio is indeed an interface standard, but the implementation efficiency of different operating systems is not necessarily the same.

6:
> I understand that AIO is just an interface standard. Each platform has its own implementation.
> Just as various compilers of STL have their own implementations. Therefore, your question is of little significance.

7:
In either of these ways, write a simple echo service separately, and then test the stress of the Service to compare the test results?
It won't take much time to do this.

8:

AIO and epoll are not the same thing, Aio
It has already been added to linux2.4. *. However, the current AIO-based systems are mainly based on general file systems and network I/O, but few application servers use network I/O in this way. The performance of poll is greatly improved, but compared with epoll, it will map more user memory space to the kernel.
However, in the RedHat test, Aio-poll has better performance than epoll.

9:

I wrote an error,
In the RedHat test, epoll has better performance than AIO-poll. The use of AIO mainly helps improve the performance of poll.

10:
AIO is a set of standards,
Each operating system can or cannot be implemented.
It is best to use the recommended operating system mode in the case of high concurrency on different operating systems.
Kuoxin also said that Linux does not implement AIO in the network mode. In fact, I think it is the closest
The Network AIO is the iocp in windows. Epoll is not AIO.

11:

Yes? I remember epoll was optimized for large users, while AIO was used for large data volumes!
Are you mistaken?

11:

The authors of Linux in the print image do not approve of using AIO, and a large number of instances use epoll instead of AIO.

BTW: the boost library is called ASIO, not AIO. It seems like a single thread (I cannot remember)

12:
It is indeed called ASIO, but I remember it wrong. Io_service: Run () of ASIO can run multiple threads simultaneously.

13:
In Windows, the macro can be redefined to allow the SELECT statement to support 64 more sockets. I have tried it.

14:
Can a selector support up to 64 sockets?

15:
DDH should mean that * waitformultipleobjects can have up to * 64

16:
Is there a maximum limit on the socket that a selector can register?

17:
Select seems to have no restrictions. However, the SELECT statement is not used to connect many applications. This is because of the Efficiency of traversing * fd_set * To find the activation handle.

18:
I do not know Java. For efficiency, use C ++ and Java.
It seems that the Tao in the ace library is Java, but I am not very clear about it.

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.