UNIX Network Programming Learning (2) I/O model

Source: Internet
Author: User

There are five I/O models in UNIX

  1. Block I/O model
  2. Non-blocking I/O model
  3. I/O multiplexing (select and poll)
  4. Signal-driven I/O
  5. Asynchronous I/O
1st types: blocking the I/O operation requested by the I/O model blocks the process until the I/O operation is completed. For example:

2nd types: non-blocking I/O models

When the request for I/O operations has to make the process blocking unable to complete, do not let the process blocking, but should return an error. For example:

3rd: I/O multiplexing Model

The call to select or poll is blocked on one of the two system calls, rather than the real I/O system calls. For example:

4th types: Signal-driven I/O models

Perform signal-driven processing on the I/O operation interface, and install a signal processing program by calling sigaction. The system calls are immediately returned, and the process continues to run, not blocking. When the data is ready, the sigio signal is generated. We can call the signal processing program at any time. For example:

5th types: asynchronous I/O models

Let the kernel start and notify us after the entire operation is completed. The main difference with the signal-driven I/O is that the signal-driven I/O is the kernel that notifies us when an I/O operation can be started, the asynchronous I/O model informs us when I/O operations are completed by the kernel. For example:

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.