Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Five Icano models

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

1. Five Icano models

a. Blocking IPUBO

b. Non-blocking IPUBO

C. I use O multiplexing (select and poll)

d. Signal-driven Icano (SIGIO)

e. Asynchronous aio_ O (Posix.1 's series of functions)

1)。 Blocking Ipaw O model

The application calls an IO function, causing the application to block and wait for the data to be ready.

If the data is not ready, keep waiting. The data is ready, copied from the kernel to user space.

The Istroke O function returns a success indication.

2)。 Non-blocking Ipaw O model

Setting a socket to non-blocking tells the kernel not to sleep the process but to return an error when the requested Iripple O operation cannot be completed. In this way, our Iwhite O operation function will continue to test whether the data is ready, and if not, continue to test until the data is ready. In this continuous testing process, it will take up a lot of CPU time.

3)。 Ipaw O reuse model

The select or poll functions will be used in the Icano reuse model, which will also block the process, but unlike blocking Icano, these two functions can block multiple Icano operations at the same time. Moreover, multiple read operations and multiple write operations can be detected at the same time, and the Icano operation function is not really called until there is data to read or write.

4)。 Signal-driven Icano model

First of all, we allow the socket to do a signal-driven I _ hand O, and install a signal handler, so that the process continues to run without blocking. When the data is ready, the process receives a SIGIO signal, which can be called in the signal processing function to process the data.

5)。 Asynchronous Ipaw O model

Call the aio_read function, tell the kernel the description word, buffer pointer, buffer size, file offset, and notification method, and return immediately. When the kernel copies the data to the buffer, it notifies the application.

two。 Comparison of several Icano models

The difference between the first four models is that the first phase is basically the same, and the second phase is basically the same, copying data from the kernel to the caller's buffer. However, the two stages of asynchronous Ipaw O are different from the first four models.

3. Synchronous and asynchronous IPUBO

a. The synchronous Iswap O operation blocks the request process until the Iripple O operation completes.

The asynchronous Iswap O operation does not block the request process.

b. Our first four models are all synchronous Icano, and only the last asynchronous Ipicuro model is async Icano.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report