… | |
… | |
463 | epoll scales either O(1) or O(active_fds). |
463 | epoll scales either O(1) or O(active_fds). |
464 | |
464 | |
465 | The epoll mechanism deserves honorable mention as the most misdesigned |
465 | The epoll mechanism deserves honorable mention as the most misdesigned |
466 | of the more advanced event mechanisms: mere annoyances include silently |
466 | of the more advanced event mechanisms: mere annoyances include silently |
467 | dropping file descriptors, requiring a system call per change per file |
467 | dropping file descriptors, requiring a system call per change per file |
468 | descriptor (and unnecessary guessing of parameters), problems with dup and |
468 | descriptor (and unnecessary guessing of parameters), problems with dup, |
|
|
469 | returning before the timeout value requiring additional iterations and so |
469 | so on. The biggest issue is fork races, however - if a program forks then |
470 | on. The biggest issue is fork races, however - if a program forks then |
470 | I<both> parent and child process have to recreate the epoll set, which can |
471 | I<both> parent and child process have to recreate the epoll set, which can |
471 | take considerable time (one syscall per file descriptor) and is of course |
472 | take considerable time (one syscall per file descriptor) and is of course |
472 | hard to detect. |
473 | hard to detect. |
473 | |
474 | |
474 | Epoll is also notoriously buggy - embedding epoll fds I<should> work, but |
475 | Epoll is also notoriously buggy - embedding epoll fds I<should> work, but |