… | |
… | |
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 |
… | |
… | |
823 | Can be used to make a call to C<ev_run> return early (but only after it |
824 | Can be used to make a call to C<ev_run> return early (but only after it |
824 | has processed all outstanding events). The C<how> argument must be either |
825 | has processed all outstanding events). The C<how> argument must be either |
825 | C<EVBREAK_ONE>, which will make the innermost C<ev_run> call return, or |
826 | C<EVBREAK_ONE>, which will make the innermost C<ev_run> call return, or |
826 | C<EVBREAK_ALL>, which will make all nested C<ev_run> calls return. |
827 | C<EVBREAK_ALL>, which will make all nested C<ev_run> calls return. |
827 | |
828 | |
828 | This "unloop state" will be cleared when entering C<ev_run> again. |
829 | This "break state" will be cleared when entering C<ev_run> again. |
829 | |
830 | |
830 | It is safe to call C<ev_break> from outside any C<ev_run> calls. ##TODO## |
831 | It is safe to call C<ev_break> from outside any C<ev_run> calls, too. |
831 | |
832 | |
832 | =item ev_ref (loop) |
833 | =item ev_ref (loop) |
833 | |
834 | |
834 | =item ev_unref (loop) |
835 | =item ev_unref (loop) |
835 | |
836 | |