I/O model

Source: Internet
Author: User
What is synchronous and asynchronous I/O?

Synchronous I/O, the initiator of the operation must wait until the receiver finishes processing the I/O

asynchronous I/O, the initiator of the operation does not wait for the receiver to finish processing I/O

Blocking I/O, the receiver of the operation must wait until the sender sends I/O

Non-blocking I/O, the receiver of the operation does not wait for the sender to send I/O

Note: In the following, the pair uses synchronous/blocking (Blocking), asynchronous/non-blocking (non-blocking), which is not differentiated.

Why are there two I/O models?

The synchronous I/O model is easy to understand and easy to use, but requires waiting for I/O operations to execute, so performance is severely limited.

The basic motivation for asynchronous I/O is high performance . In fact, it is based on a two-point premise hypothesis:

  1. I/O operations are time-consuming, and during I/O, there is plenty of timing for the CPU to perform other task instructions.
  2. When the results returned by an I/O operation are not available, a large number of instructions can be executed.

If these two prerequisites are not met, program performance may not be improved even with an efficient asynchronous I/O model.

I/O model

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.