In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
1. The steps of one input and output:
1) wait for the data to be ready
2) data relocation
2. 5 kinds of Istroke O models
1) blocking Imax O model:
The application calls an Istroke O function, causing the application to block and wait for the data to be ready. If the data is not ready, wait. The data is ready, and from the kernel to the user space, the Istroke O function returns a success indication.
2) non-blocking Ithumb O:
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) I use 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.
Compared with the non-blocking IO model, in the multiplexing IO model, a thread constantly polls the state of multiple socket (because in the multiplexing IO model, only one thread can be used to manage multiple socket, the system does not need to build new processes or threads, nor does it have to maintain these threads and processes, so it greatly reduces resource consumption).
In addition, the reason why multiplexing IO is more efficient than non-blocking IO model is that in non-blocking IO, constantly asking socket status is done through user threads, while in multiplexing IO, polling each socket state is carried out by the kernel, which is much more efficient than user threads.
4) signal-driven Istroke O 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.
The data relocation action of the above Iripple O is the same, but the waiting method is not the same. It is called synchronous Iripple O (all actions are self-operated).
5) Asynchronous Imax 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.
3. Summary
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.