summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root>2007-11-28 11:27:29 +0000
committerroot <root>2007-11-28 11:27:29 +0000
commit01a7af5110dcd6e711dd27c0fa7fa68c23380186 (patch)
treefe30d27819a0a111df14dcd46a2b699c57d764f1
parent71217f48ea498d7292ca3bf17b8bffe1ab97e642 (diff)
*** empty log message ***
-rw-r--r--ev.331
-rw-r--r--ev.html15
-rw-r--r--ev.pod13
3 files changed, 39 insertions, 20 deletions
diff --git a/ev.3 b/ev.3
index 979b314..439489a 100644
--- a/ev.3
+++ b/ev.3
@@ -129,7 +129,7 @@
.\" ========================================================================
.\"
.IX Title ""<STANDARD INPUT>" 1"
-.TH "<STANDARD INPUT>" 1 "2007-11-27" "perl v5.8.8" "User Contributed Perl Documentation"
+.TH "<STANDARD INPUT>" 1 "2007-11-28" "perl v5.8.8" "User Contributed Perl Documentation"
.SH "NAME"
libev \- a high performance full\-featured event loop written in C
.SH "SYNOPSIS"
@@ -1385,7 +1385,7 @@ otherwise always forced to be at least one) and all the other fields of
the stat buffer having unspecified contents.
.PP
Since there is no standard to do this, the portable implementation simply
-calls \f(CW\*(C`stat (2)\*(C'\fR regulalry on the path to see if it changed somehow. You
+calls \f(CW\*(C`stat (2)\*(C'\fR 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 \f(CW0\fR (highly recommended!) then a \fIsuitable,
unspecified default\fR value will be used (which you can expect to be around
@@ -1397,8 +1397,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.
.PP
-At the time of this writing, no specific \s-1OS\s0 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 \f(CW\*(C`ev_stat\*(C'\fR 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.
.IP "ev_stat_init (ev_stat *, callback, const char *path, ev_tstamp interval)" 4
.IX Item "ev_stat_init (ev_stat *, callback, const char *path, ev_tstamp interval)"
.PD 0
@@ -2172,6 +2177,11 @@ backend for Solaris 10 systems.
.IP "\s-1EV_USE_DEVPOLL\s0" 4
.IX Item "EV_USE_DEVPOLL"
reserved for future expansion, works like the \s-1USE\s0 symbols above.
+.IP "\s-1EV_USE_INOTIFY\s0" 4
+.IX Item "EV_USE_INOTIFY"
+If defined to be \f(CW1\fR, libev will compile in support for the Linux inotify
+interface to speed up \f(CW\*(C`ev_stat\*(C'\fR watchers. Its actual availability will
+be detected at runtime.
.IP "\s-1EV_H\s0" 4
.IX Item "EV_H"
The name of the \fIev.h\fR header file used to include it. The default if
@@ -2226,7 +2236,14 @@ some inlining decisions, saves roughly 30% codesize of amd64.
\&\f(CW\*(C`ev_child\*(C'\fR watchers use a small hash table to distribute workload by
pid. The default size is \f(CW16\fR (or \f(CW1\fR with \f(CW\*(C`EV_MINIMAL\*(C'\fR), usually more
than enough. If you need to manage thousands of children you might want to
-increase this value.
+increase this value (\fImust\fR be a power of two).
+.IP "\s-1EV_INOTIFY_HASHSIZE\s0" 4
+.IX Item "EV_INOTIFY_HASHSIZE"
+\&\f(CW\*(C`ev_staz\*(C'\fR watchers use a small hash table to distribute workload by
+inotify watch id. The default size is \f(CW16\fR (or \f(CW1\fR with \f(CW\*(C`EV_MINIMAL\*(C'\fR),
+usually more than enough. If you need to manage thousands of \f(CW\*(C`ev_stat\*(C'\fR
+watchers you might want to increase this value (\fImust\fR be a power of
+two).
.IP "\s-1EV_COMMON\s0" 4
.IX Item "EV_COMMON"
By default, all watchers have a \f(CW\*(C`void *data\*(C'\fR member. By redefining
@@ -2300,8 +2317,8 @@ documentation for \f(CW\*(C`ev_default_init\*(C'\fR.
.IX Item "Starting io/check/prepare/idle/signal/child watchers: O(1)"
.IP "Stopping check/prepare/idle watchers: O(1)" 4
.IX Item "Stopping check/prepare/idle watchers: O(1)"
-.IP "Stopping an io/signal/child watcher: O(number_of_watchers_for_this_(fd/signal/pid % 16))" 4
-.IX Item "Stopping an io/signal/child watcher: O(number_of_watchers_for_this_(fd/signal/pid % 16))"
+.IP "Stopping an io/signal/child watcher: O(number_of_watchers_for_this_(fd/signal/pid % \s-1EV_PID_HASHSIZE\s0))" 4
+.IX Item "Stopping an io/signal/child watcher: O(number_of_watchers_for_this_(fd/signal/pid % EV_PID_HASHSIZE))"
.IP "Finding the next timer per loop iteration: O(1)" 4
.IX Item "Finding the next timer per loop iteration: O(1)"
.IP "Each change on a file descriptor per loop iteration: O(number_of_watchers_for_this_fd)" 4
diff --git a/ev.html b/ev.html
index ec6eb1b..4c6249e 100644
--- a/ev.html
+++ b/ev.html
@@ -6,7 +6,7 @@
<meta name="description" content="Pod documentation for libev" />
<meta name="inputfile" content="&lt;standard input&gt;" />
<meta name="outputfile" content="&lt;standard output&gt;" />
- <meta name="created" content="Wed Nov 28 12:27:27 2007" />
+ <meta name="created" content="Wed Nov 28 12:31:29 2007" />
<meta name="generator" content="Pod::Xhtml 1.57" />
<link rel="stylesheet" href="http://res.tst.eu/pod.css"/></head>
<body>
@@ -135,12 +135,13 @@ watcher.</p>
</div>
<h1 id="FEATURES">FEATURES</h1>
<div id="FEATURES_CONTENT">
-<p>Libev supports <code>select</code>, <code>poll</code>, the linux-specific <code>epoll</code>, the
-bsd-specific <code>kqueue</code> and the solaris-specific event port mechanisms
-for file descriptor events (<code>ev_io</code>), relative timers (<code>ev_timer</code>),
-absolute timers with customised rescheduling (<code>ev_periodic</code>), synchronous
-signals (<code>ev_signal</code>), process status change events (<code>ev_child</code>), and
-event watchers dealing with the event loop mechanism itself (<code>ev_idle</code>,
+<p>Libev supports <code>select</code>, <code>poll</code>, the Linux-specific <code>epoll</code>, the
+BSD-specific <code>kqueue</code> and the Solaris-specific event port mechanisms
+for file descriptor events (<code>ev_io</code>), the Linux <code>inotify</code> interface
+(for <code>ev_stat</code>), relative timers (<code>ev_timer</code>), absolute timers
+with customised rescheduling (<code>ev_periodic</code>), synchronous signals
+(<code>ev_signal</code>), process status change events (<code>ev_child</code>), and event
+watchers dealing with the event loop mechanism itself (<code>ev_idle</code>,
<code>ev_embed</code>, <code>ev_prepare</code> and <code>ev_check</code> watchers) as well as
file watchers (<code>ev_stat</code>) and even limited support for fork events
(<code>ev_fork</code>).</p>
diff --git a/ev.pod b/ev.pod
index 8b57eb4..fbb7ff3 100644
--- a/ev.pod
+++ b/ev.pod
@@ -65,12 +65,13 @@ watcher.
=head1 FEATURES
-Libev supports C<select>, C<poll>, the linux-specific C<epoll>, the
-bsd-specific C<kqueue> and the solaris-specific event port mechanisms
-for file descriptor events (C<ev_io>), relative timers (C<ev_timer>),
-absolute timers with customised rescheduling (C<ev_periodic>), synchronous
-signals (C<ev_signal>), process status change events (C<ev_child>), and
-event watchers dealing with the event loop mechanism itself (C<ev_idle>,
+Libev supports C<select>, C<poll>, the Linux-specific C<epoll>, the
+BSD-specific C<kqueue> and the Solaris-specific event port mechanisms
+for file descriptor events (C<ev_io>), the Linux C<inotify> interface
+(for C<ev_stat>), relative timers (C<ev_timer>), absolute timers
+with customised rescheduling (C<ev_periodic>), synchronous signals
+(C<ev_signal>), process status change events (C<ev_child>), and event
+watchers dealing with the event loop mechanism itself (C<ev_idle>,
C<ev_embed>, C<ev_prepare> and C<ev_check> watchers) as well as
file watchers (C<ev_stat>) and even limited support for fork events
(C<ev_fork>).