Linux v IO model

Source: Internet
Author: User

    1. Blocking IO Model

The user space calls the Recvfrom command until the packet arrives and is copied to the buffer of the application process or when an error occurs, and the process or thread waits for a blocking state.

2. Non-blocking IO model

After the user space calls the kernel instruction recvfrom, if the kernel space buffer does not have data session Ewouldblock the process repeats (polls) call the Recvfrom command call to see if there are packets ready in the buffer

3.IO multiplexed Linux provides the select/poll process to block a select operation by passing one or more FD to a Select or poll system call so select can help us detect if multiple FD are in a consistent state.

4. The signal driver first turns on the socket signal driver I/O function by calling the system sigaction to execute a signal handler function (when the system call returns immediately the process continues to work without blocking) when the data is ready to generate a sigio signal, through the signal

Callback notification application calls Recvfrom to read data and notifies the main loop function to process the data

5. Asynchronous IO tells the kernel to initiate an operation and let the kernel notify us when the entire operation is complete, including copying data from the kernel to the user's own buffer zone

Linux v IO 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.