In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail what is the difference between select, poll and epoll. The content of the article is of high quality, so the editor will share it with you for reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.
Fd refers to the file descriptor
Select
Time complexity O (n)
Indiscriminately poll all streams to find streams that can read or write data, and operate on them
Poll
Then query the device status corresponding to each fd
Time complexity O (n)
Poll is essentially no different from select.
It copies the array passed in by the user to the kernel space
But it has no limit on the maximum number of connections because it is stored based on linked lists.
Epoll
At this point, our operations on these streams are meaningful.
Time complexity O (1)
It can be understood as event poll.
Epoll is actually event-driven (each event is associated with a fd)
But select,poll,epoll is essentially synchronous iBandO
Because they all need to be responsible for reading and writing themselves after the read and write events are ready.
That is to say, the reading and writing process is blocked.
On the other hand, the implementation of asynchronous Iripple O is responsible for copying data from the kernel to user space without having to read and write on its own.
AIO is also based on epoll.
Copy data from the kernel to user space
About select, poll, epoll what is the difference between what is shared here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
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.