Let's look at five I/O models ., Five I/O models

Source: Internet
Author: User

Let's look at five I/O models ., Five I/O models

The application process is: James

Kernel: John

1 blocking I/O model:

James borrowed rice for cooking from Mr. Wang. Mr. Wang didn't have it for now, but he didn't do anything else at this time (for example, he could still wash his dishes at this time). He waited until Mr. Wang had rice, then James moved the rice to his house and started cooking.

2 non-blocking I/O models:

James borrowed rice for cooking from Mr. Wang, but Mr. Wang didn't. But at this time, he went to wash his food. Every time he washed it, he asked Mr. Wang if he had prepared rice until Mr. Wang had rice, then James moved the rice to his house and started cooking.

3 I/O Reuse Model:

Many people in the village have no rice for cooking, and they all want to borrow rice from Mr. Wang. In this way, no matter if you ask Mr. Smith at intervals, or if you want to tell him where he died, he will at least not do other things well,

In this way, you can find an agent. Then, let's talk about the situation and let the agent interact with Mr. Wang. When data arrives, the agent notifies a specific person, and then the person carries the rice to his home and starts cooking.

4. Signal driving model:

James borrowed rice to cook at Mr. Wang, but Mr. Wang didn't. But he went to wash his food at this time, instead of waiting somewhere, or asked Mr. Wang continuously, because Mr. Wang will take the initiative to notify James when he has rice, at the arrival of the notice, James carried the rice to his house and began to cook.

5 asynchronous model:

James borrowed rice to cook at Mr. Wang. Then James told Mr. Wang that he had to borrow rice and then did other things. When Mr. Wang had rice, he took the initiative to take the rice to James's house, james started to cook at this time.

 

Synchronization: the application process actively copies data to the user space.

Asynchronous: the kernel is responsible for copying data to the user space. In this process, the application process is still doing its own thing.

 

Blocking, non-blocking, I/O multiplexing, and signal driving are all synchronous. The final Asynchronization is the true Asynchronization.

 

 

Refer:

Http://blog.csdn.net/lovelinx/article/details/39924473

 

 

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.