The two mechanisms of select and Epoll are multi-path I/O mechanism solutions, select is the POSIX standard, and Epoll is unique to Linux.
The biggest benefit of epoll is that it does not decrease efficiency with the number of FD, polling processing in Selec, where the data structure is similar to the data structure of an array, and epoll is maintaining a queue, directly looking at whether the queue is empty.
Nginx is the use of epoll to achieve I/O multiplexing support high concurrency, currently in high concurrency scenarios, nginx more and more welcome.
A disadvantage of select is that there is a maximum limit on the number of file descriptors that a single process can monitor
Epoll:
(1) The efficiency of IO does not decrease as the number of monitored FD increases. Epoll is not the same as select and poll polling, but is implemented by each FD-defined callback function. Only the ready FD will execute the callback function;
(2) Support level-triggering and edge-triggering (just tell the process which file descriptor has just become ready, it only says it again, if we do not take action, then it will not be told again, this way is called edge triggering) two ways, the theoretical edge trigger performance is higher, but the code implementation is quite complex.
(3) Have a good notification mechanism for readiness events
Select
(1) The number of FD that can be monitored by a single process is limited, and on a 32-bit machine, the maximum number of FD He can manage is 1024;
(2) When scanning the socket is a linear scan, when the number of socket file descriptor has changed, a lot of time is wasted.
'). addclass (' pre-numbering '). Hide (); $ (this). addclass (' has-numbering '). Parent (). append ($numbering); for (i = 1; i <= lines; i++) {$numbering. Append ($ ('
'). Text (i)); }; $numbering. FadeIn (1700); }); });
The above describes the select and Epoll, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.