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

Comparing libev/ev.html (file contents):
Revision 1.28 by root, Sun Nov 18 03:43:24 2007 UTC vs.
Revision 1.29 by root, Thu Nov 22 12:28:27 2007 UTC

4<head> 4<head>
5 <title>libev</title> 5 <title>libev</title>
6 <meta name="description" content="Pod documentation for libev" /> 6 <meta name="description" content="Pod documentation for libev" />
7 <meta name="inputfile" content="&lt;standard input&gt;" /> 7 <meta name="inputfile" content="&lt;standard input&gt;" />
8 <meta name="outputfile" content="&lt;standard output&gt;" /> 8 <meta name="outputfile" content="&lt;standard output&gt;" />
9 <meta name="created" content="Sun Nov 18 04:43:20 2007" /> 9 <meta name="created" content="Thu Nov 22 13:26:17 2007" />
10 <meta name="generator" content="Pod::Xhtml 1.57" /> 10 <meta name="generator" content="Pod::Xhtml 1.57" />
11<link rel="stylesheet" href="http://res.tst.eu/pod.css"/></head> 11<link rel="stylesheet" href="http://res.tst.eu/pod.css"/></head>
12<body> 12<body>
13<div class="pod"> 13<div class="pod">
14<!-- INDEX START --> 14<!-- INDEX START -->
186<code>LIBEV_FLAGS</code>. Otherwise (the default), this environment variable will 186<code>LIBEV_FLAGS</code>. Otherwise (the default), this environment variable will
187override the flags completely if it is found in the environment. This is 187override the flags completely if it is found in the environment. This is
188useful to try out specific backends to test their performance, or to work 188useful to try out specific backends to test their performance, or to work
189around bugs.</p> 189around bugs.</p>
190 </dd> 190 </dd>
191 <dt><code>EVMETHOD_SELECT</code> (portable select backend)</dt> 191 <dt><code>EVMETHOD_SELECT</code> (value 1, portable select backend)</dt>
192 <dd>
193 <p>This is your standard select(2) backend. Not <i>completely</i> standard, as
194libev tries to roll its own fd_set with no limits on the number of fds,
195but if that fails, expect a fairly low limit on the number of fds when
196using this backend. It doesn't scale too well (O(highest_fd)), but its usually
197the fastest backend for a low number of fds.</p>
198 </dd>
192 <dt><code>EVMETHOD_POLL</code> (poll backend, available everywhere except on windows)</dt> 199 <dt><code>EVMETHOD_POLL</code> (value 2, poll backend, available everywhere except on windows)</dt>
193 <dt><code>EVMETHOD_EPOLL</code> (linux only)</dt> 200 <dd>
194 <dt><code>EVMETHOD_KQUEUE</code> (some bsds only)</dt> 201 <p>And this is your standard poll(2) backend. It's more complicated than
195 <dt><code>EVMETHOD_DEVPOLL</code> (solaris 8 only)</dt> 202select, but handles sparse fds better and has no artificial limit on the
196 <dt><code>EVMETHOD_PORT</code> (solaris 10 only)</dt> 203number of fds you can use (except it will slow down considerably with a
204lot of inactive fds). It scales similarly to select, i.e. O(total_fds).</p>
197 <dd> 205 </dd>
198 <p>If one or more of these are ored into the flags value, then only these 206 <dt><code>EVMETHOD_EPOLL</code> (value 4, Linux)</dt>
199backends will be tried (in the reverse order as given here). If one are 207 <dd>
200specified, any backend will do.</p> 208 <p>For few fds, this backend is a bit little slower than poll and select,
209but it scales phenomenally better. While poll and select usually scale like
210O(total_fds) where n is the total number of fds (or the highest fd), epoll scales
211either O(1) or O(active_fds).</p>
212 <p>While stopping and starting an I/O watcher in the same iteration will
213result in some caching, there is still a syscall per such incident
214(because the fd could point to a different file description now), so its
215best to avoid that. Also, dup()ed file descriptors might not work very
216well if you register events for both fds.</p>
217 </dd>
218 <dt><code>EVMETHOD_KQUEUE</code> (value 8, most BSD clones)</dt>
219 <dd>
220 <p>Kqueue deserves special mention, as at the time of this writing, it
221was broken on all BSDs except NetBSD (usually it doesn't work with
222anything but sockets and pipes, except on Darwin, where of course its
223completely useless). For this reason its not being &quot;autodetected&quot; unless
224you explicitly specify the flags (i.e. you don't use EVFLAG_AUTO).</p>
225 <p>It scales in the same way as the epoll backend, but the interface to the
226kernel is more efficient (which says nothing about its actual speed, of
227course). While starting and stopping an I/O watcher does not cause an
228extra syscall as with epoll, it still adds up to four event changes per
229incident, so its best to avoid that.</p>
230 </dd>
231 <dt><code>EVMETHOD_DEVPOLL</code> (value 16, Solaris 8)</dt>
232 <dd>
233 <p>This is not implemented yet (and might never be).</p>
234 </dd>
235 <dt><code>EVMETHOD_PORT</code> (value 32, Solaris 10)</dt>
236 <dd>
237 <p>This uses the Solaris 10 port mechanism. As with everything on Solaris,
238it's really slow, but it still scales very well (O(active_fds)).</p>
239 </dd>
240 <dt><code>EVMETHOD_ALL</code></dt>
241 <dd>
242 <p>Try all backends (even potentially broken ones). Since this is a mask, you
243can do stuff like <code>EVMETHOD_ALL &amp; ~EVMETHOD_KQUEUE</code>.</p>
201 </dd> 244 </dd>
202 </dl> 245 </dl>
203 </p> 246 </p>
247 <p>If one or more of these are ored into the flags value, then only these
248backends will be tried (in the reverse order as given here). If none are
249specified, most compiled-in backend will be tried, usually in reverse
250order of their flag values :)</p>
204 </dd> 251 </dd>
205 <dt>struct ev_loop *ev_loop_new (unsigned int flags)</dt> 252 <dt>struct ev_loop *ev_loop_new (unsigned int flags)</dt>
206 <dd> 253 <dd>
207 <p>Similar to <code>ev_default_loop</code>, but always creates a new event loop that is 254 <p>Similar to <code>ev_default_loop</code>, but always creates a new event loop that is
208always distinct from the default loop. Unlike the default loop, it cannot 255always distinct from the default loop. Unlike the default loop, it cannot

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines