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

Comparing libev/ev.pod (file contents):
Revision 1.369 by root, Mon May 30 18:34:28 2011 UTC vs.
Revision 1.370 by root, Thu Jun 2 23:42:40 2011 UTC

4990.1ms) and so on. The biggest issue is fork races, however - if a program 4990.1ms) and so on. The biggest issue is fork races, however - if a program
500forks then I<both> parent and child process have to recreate the epoll 500forks then I<both> parent and child process have to recreate the epoll
501set, which can take considerable time (one syscall per file descriptor) 501set, which can take considerable time (one syscall per file descriptor)
502and is of course hard to detect. 502and is of course hard to detect.
503 503
504Epoll is also notoriously buggy - embedding epoll fds I<should> work, but 504Epoll is also notoriously buggy - embedding epoll fds I<should> work,
505of course I<doesn't>, and epoll just loves to report events for totally 505but of course I<doesn't>, and epoll just loves to report events for
506I<different> file descriptors (even already closed ones, so one cannot 506totally I<different> file descriptors (even already closed ones, so
507even remove them from the set) than registered in the set (especially 507one cannot even remove them from the set) than registered in the set
508on SMP systems). Libev tries to counter these spurious notifications by 508(especially on SMP systems). Libev tries to counter these spurious
509employing an additional generation counter and comparing that against the 509notifications by employing an additional generation counter and comparing
510events to filter out spurious ones, recreating the set when required. Last 510that against the events to filter out spurious ones, recreating the set
511when required. Epoll also errornously rounds down timeouts, but gives you
512no way to know when and by how much, so sometimes you have to busy-wait
513because epoll returns immediately despite a nonzero timeout. And last
511not least, it also refuses to work with some file descriptors which work 514not least, it also refuses to work with some file descriptors which work
512perfectly fine with C<select> (files, many character devices...). 515perfectly fine with C<select> (files, many character devices...).
513 516
514Epoll is truly the train wreck analog among event poll mechanisms, 517Epoll is truly the train wreck among event poll mechanisms, a frankenpoll,
515a frankenpoll, cobbled together in a hurry, no thought to design or 518cobbled together in a hurry, no thought to design or interaction with
516interaction with others. 519others. Oh, the pain, will it ever stop...
517 520
518While stopping, setting and starting an I/O watcher in the same iteration 521While stopping, setting and starting an I/O watcher in the same iteration
519will result in some caching, there is still a system call per such 522will result in some caching, there is still a system call per such
520incident (because the same I<file descriptor> could point to a different 523incident (because the same I<file descriptor> could point to a different
521I<file description> now), so its best to avoid that. Also, C<dup ()>'ed 524I<file description> now), so its best to avoid that. Also, C<dup ()>'ed

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines