X-Git-Url: https://git.llucax.com/software/libev.git/blobdiff_plain/d62943221d916737d52e83db662e6a1e2f92db0a..71217f48ea498d7292ca3bf17b8bffe1ab97e642:/ev.pod diff --git a/ev.pod b/ev.pod index cac8de1..8b57eb4 100644 --- a/ev.pod +++ b/ev.pod @@ -1224,7 +1224,7 @@ otherwise always forced to be at least one) and all the other fields of the stat buffer having unspecified contents. Since there is no standard to do this, the portable implementation simply -calls C regulalry on the path to see if it changed somehow. You +calls C regularly on the path to see if it changed somehow. You can specify a recommended polling interval for this case. If you specify a polling interval of C<0> (highly recommended!) then a I value will be used (which you can expect to be around @@ -1236,8 +1236,13 @@ This watcher type is not meant for massive numbers of stat watchers, as even with OS-supported change notifications, this can be resource-intensive. -At the time of this writing, no specific OS backends are implemented, but -if demand increases, at least a kqueue and inotify backend will be added. +At the time of this writing, only the Linux inotify interface is +implemented (implementing kqueue support is left as an exercise for the +reader). Inotify will be used to give hints only and should not change the +semantics of C watchers, which means that libev sometimes needs +to fall back to regular polling again even with inotify, but changes are +usually detected immediately, and if the file exists there will be no +polling. =over 4 @@ -2016,6 +2021,12 @@ backend for Solaris 10 systems. reserved for future expansion, works like the USE symbols above. +=item EV_USE_INOTIFY + +If defined to be C<1>, libev will compile in support for the Linux inotify +interface to speed up C watchers. Its actual availability will +be detected at runtime. + =item EV_H The name of the F header file used to include it. The default if @@ -2080,7 +2091,15 @@ some inlining decisions, saves roughly 30% codesize of amd64. C watchers use a small hash table to distribute workload by pid. The default size is C<16> (or C<1> with C), usually more than enough. If you need to manage thousands of children you might want to -increase this value. +increase this value (I be a power of two). + +=item EV_INOTIFY_HASHSIZE + +C watchers use a small hash table to distribute workload by +inotify watch id. The default size is C<16> (or C<1> with C), +usually more than enough. If you need to manage thousands of C +watchers you might want to increase this value (I be a power of +two). =item EV_COMMON @@ -2150,7 +2169,7 @@ documentation for C. =item Stopping check/prepare/idle watchers: O(1) -=item Stopping an io/signal/child watcher: O(number_of_watchers_for_this_(fd/signal/pid % 16)) +=item Stopping an io/signal/child watcher: O(number_of_watchers_for_this_(fd/signal/pid % EV_PID_HASHSIZE)) =item Finding the next timer per loop iteration: O(1)