ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libev/ev.pod
(Generate patch)

Comparing libev/ev.pod (file contents):
Revision 1.204 by root, Mon Oct 27 11:08:29 2008 UTC vs.
Revision 1.205 by root, Mon Oct 27 12:20:32 2008 UTC

384=item C<EVBACKEND_EPOLL> (value 4, Linux) 384=item C<EVBACKEND_EPOLL> (value 4, Linux)
385 385
386For few fds, this backend is a bit little slower than poll and select, 386For few fds, this backend is a bit little slower than poll and select,
387but it scales phenomenally better. While poll and select usually scale 387but it scales phenomenally better. While poll and select usually scale
388like O(total_fds) where n is the total number of fds (or the highest fd), 388like O(total_fds) where n is the total number of fds (or the highest fd),
389epoll scales either O(1) or O(active_fds). The epoll design has a number 389epoll scales either O(1) or O(active_fds).
390of shortcomings, such as silently dropping events in some hard-to-detect 390
391cases and requiring a system call per fd change, no fork support and bad 391The epoll syscalls are the most misdesigned of the more advanced
392support for dup. 392event mechanisms: probelsm include silently dropping events in some
393hard-to-detect cases, requiring a system call per fd change, no fork
394support, problems with dup and so on.
393 395
394Epoll is also notoriously buggy - embedding epoll fds should work, but 396Epoll is also notoriously buggy - embedding epoll fds should work, but
395of course doesn't, and epoll just loves to report events for totally 397of course doesn't, and epoll just loves to report events for totally
396I<different> file descriptors (even already closed ones) than registered 398I<different> file descriptors (even already closed ones, so one cannot
397in the set (especially on SMP systems). Libev tries to counter these 399even remove them from the set) than registered in the set (especially
398spurious notifications by employing an additional generation counter and 400on SMP systems). Libev tries to counter these spurious notifications by
399comparing that against the events to filter out spurious ones. 401employing an additional generation counter and comparing that against the
402events to filter out spurious ones.
400 403
401While stopping, setting and starting an I/O watcher in the same iteration 404While stopping, setting and starting an I/O watcher in the same iteration
402will result in some caching, there is still a system call per such incident 405will result in some caching, there is still a system call per such incident
403(because the fd could point to a different file description now), so its 406(because the fd could point to a different file description now), so its
404best to avoid that. Also, C<dup ()>'ed file descriptors might not work 407best to avoid that. Also, C<dup ()>'ed file descriptors might not work

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines