The difference between the Unix network programming Select and the Epool function

Source: Internet
Author: User
Tags epoll

the difference between Epool and select:
Select the maximum FD opened in a process is limited, set by Fd_setsize, and the default value is 2048. However, Epoll does not have this restriction, it supports the FD limit is the maximum number of open files, this number is generally far greater than 2048, generally speaking, the larger the memory, the higher the FD cap, 1G memory can reach about 10w.

Select polling mechanism is the system will go to find each FD whether the data is ready, when FD a lot of time, the efficiency of course fell straight down, epoll using event-based notification method, once an FD data is ready, the kernel will adopt a similar callback callback mechanism, Quickly activating this file descriptor without ever having to poll for a ready-to-find descriptor is the most essential reason for epool efficiency.

both Select and Epoll require the kernel to notify the user of the FD message, and it is important to avoid unnecessary memory copies, where Epoll is implemented by the kernel in user space mmap the same piece of memory, and select makes unnecessary copies

The difference between the Unix network programming Select and the Epool function

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.