BIO | NIO | AIO (Java Edition)

Source: Internet
Author: User
Tags epoll

https://m.oschina.net/blog/132361

Implementation principle

Say the principle of implementation, but also from the operating system IO model to understand

According to the UNIX network programming, the IO model can be divided into: blocking IO, non-blocking IO, IO multiplexing, signal driven IO and asynchronous Io, divided into two categories according to POSIX standard: synchronous IO and asynchronous IO. How do you differentiate it? First IO operation is actually divided into two steps: Initiate IO request and actual IO operation, the difference between synchronous IO and asynchronous IO is whether the second step is blocked, if the actual IO read/write blocking request process, then is synchronous io, so blocking IO, non-blocking IO, io multiplexing, The signal-driven IO is synchronous io, if not blocking, but the operating system to help you do the IO operation and return the results to you, then the asynchronous IO. The difference between blocking IO and non-blocking IO is that the first step is whether the initiating IO request will be blocked, and if blocking until done is the traditional blocking IO, and if it does not block, then it is non-blocking IO.

Received the operating system IO model, but also have to mention SELECT/POLL/EPOLL/IOCP, about the four understanding, not much to explain, I have not understood in place.

Understandably, after Linux 2.6, the implementation of Java NIO is achieved through Epoll, which can be found through the source code of the JDK. AIO, which is implemented through IOCP on Windows, is implemented by Epoll on Linux.

One thing to emphasize here: AIO, which is the I/O processing mode, and Epoll is a programming model for AIO; in other words, AIO is an interface standard that can be implemented or not implemented by each operating system. It is best to use operating system recommendations in high concurrency situations on different operating systems. There is no AIO on Linux that really implements the network way.

BIO | NIO | AIO (Java Edition)

Related Article

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.