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

Comparing libev/ev.pod (file contents):
Revision 1.304 by root, Thu Oct 14 04:30:46 2010 UTC vs.
Revision 1.306 by root, Mon Oct 18 07:36:05 2010 UTC

439of course I<doesn't>, and epoll just loves to report events for totally 439of course I<doesn't>, and epoll just loves to report events for totally
440I<different> file descriptors (even already closed ones, so one cannot 440I<different> file descriptors (even already closed ones, so one cannot
441even remove them from the set) than registered in the set (especially 441even remove them from the set) than registered in the set (especially
442on SMP systems). Libev tries to counter these spurious notifications by 442on SMP systems). Libev tries to counter these spurious notifications by
443employing an additional generation counter and comparing that against the 443employing an additional generation counter and comparing that against the
444events to filter out spurious ones, recreating the set when required. 444events to filter out spurious ones, recreating the set when required. Last
445not least, it also refuses to work with some file descriptors which work
446perfectly fine with C<select> (files, many character devices...).
445 447
446While stopping, setting and starting an I/O watcher in the same iteration 448While stopping, setting and starting an I/O watcher in the same iteration
447will result in some caching, there is still a system call per such 449will result in some caching, there is still a system call per such
448incident (because the same I<file descriptor> could point to a different 450incident (because the same I<file descriptor> could point to a different
449I<file description> now), so its best to avoid that. Also, C<dup ()>'ed 451I<file description> now), so its best to avoid that. Also, C<dup ()>'ed
4441 4443
4442=head3 C<select> is buggy 4444=head3 C<select> is buggy
4443 4445
4444All that's left is C<select>, and of course Apple found a way to fuck this 4446All that's left is C<select>, and of course Apple found a way to fuck this
4445one up as well: On OS/X, C<select> actively limits the number of file 4447one up as well: On OS/X, C<select> actively limits the number of file
4446descriptors you can pass in to 1024 - your program suddenyl crashes when 4448descriptors you can pass in to 1024 - your program suddenly crashes when
4447you use more. 4449you use more.
4448 4450
4449There is an undocumented "workaround" for this - defining 4451There is an undocumented "workaround" for this - defining
4450C<_DARWIN_UNLIMITED_SELECT>, which libev tries to use, so select I<should> 4452C<_DARWIN_UNLIMITED_SELECT>, which libev tries to use, so select I<should>
4451work on OS/X. 4453work on OS/X.
4468this mechanism is very buggy. If you run into high CPU usage, your program 4470this mechanism is very buggy. If you run into high CPU usage, your program
4469freezes or you get a large number of spurious wakeups, make sure you have 4471freezes or you get a large number of spurious wakeups, make sure you have
4470all the relevant and latest kernel patches applied. No, I don't know which 4472all the relevant and latest kernel patches applied. No, I don't know which
4471ones, but there are multiple ones. 4473ones, but there are multiple ones.
4472 4474
4473If you can't get it to work, you can try running the program with 4475If you can't get it to work, you can try running the program by setting
4474C<LIBEV_FLAGS=3> to only allow C<poll> and C<select> backends. 4476the environment variable C<LIBEV_FLAGS=3> to only allow C<poll> and
4477C<select> backends.
4475 4478
4476=head2 AIX POLL BUG 4479=head2 AIX POLL BUG
4477 4480
4478AIX unfortunately has a broken C<poll.h> header. Libev works around 4481AIX unfortunately has a broken C<poll.h> header. Libev works around
4479this by trying to avoid the poll backend altogether (i.e. it's not even 4482this by trying to avoid the poll backend altogether (i.e. it's not even

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines