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

Comparing libev/ev.html (file contents):
Revision 1.32 by root, Fri Nov 23 05:14:58 2007 UTC vs.
Revision 1.33 by root, Fri Nov 23 08:36:35 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="Fri Nov 23 06:14:47 2007" /> 9 <meta name="created" content="Fri Nov 23 09:26:40 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 -->
228 <p>While stopping and starting an I/O watcher in the same iteration will 228 <p>While stopping and starting an I/O watcher in the same iteration will
229result in some caching, there is still a syscall per such incident 229result in some caching, there is still a syscall per such incident
230(because the fd could point to a different file description now), so its 230(because the fd could point to a different file description now), so its
231best to avoid that. Also, dup()ed file descriptors might not work very 231best to avoid that. Also, dup()ed file descriptors might not work very
232well if you register events for both fds.</p> 232well if you register events for both fds.</p>
233 <p>Please note that epoll sometimes generates spurious notifications, so you
234need to use non-blocking I/O or other means to avoid blocking when no data
235(or space) is available.</p>
233 </dd> 236 </dd>
234 <dt><code>EVBACKEND_KQUEUE</code> (value 8, most BSD clones)</dt> 237 <dt><code>EVBACKEND_KQUEUE</code> (value 8, most BSD clones)</dt>
235 <dd> 238 <dd>
236 <p>Kqueue deserves special mention, as at the time of this writing, it 239 <p>Kqueue deserves special mention, as at the time of this writing, it
237was broken on all BSDs except NetBSD (usually it doesn't work with 240was broken on all BSDs except NetBSD (usually it doesn't work with
250 </dd> 253 </dd>
251 <dt><code>EVBACKEND_PORT</code> (value 32, Solaris 10)</dt> 254 <dt><code>EVBACKEND_PORT</code> (value 32, Solaris 10)</dt>
252 <dd> 255 <dd>
253 <p>This uses the Solaris 10 port mechanism. As with everything on Solaris, 256 <p>This uses the Solaris 10 port mechanism. As with everything on Solaris,
254it's really slow, but it still scales very well (O(active_fds)).</p> 257it's really slow, but it still scales very well (O(active_fds)).</p>
258 <p>Please note that solaris ports can result in a lot of spurious
259notifications, so you need to use non-blocking I/O or other means to avoid
260blocking when no data (or space) is available.</p>
255 </dd> 261 </dd>
256 <dt><code>EVBACKEND_ALL</code></dt> 262 <dt><code>EVBACKEND_ALL</code></dt>
257 <dd> 263 <dd>
258 <p>Try all backends (even potentially broken ones that wouldn't be tried 264 <p>Try all backends (even potentially broken ones that wouldn't be tried
259with <code>EVFLAG_AUTO</code>). Since this is a mask, you can do stuff such as 265with <code>EVFLAG_AUTO</code>). Since this is a mask, you can do stuff such as
548 <dt>ev_io_set (ev_io *, int fd, int events)</dt> 554 <dt>ev_io_set (ev_io *, int fd, int events)</dt>
549 <dd> 555 <dd>
550 <p>Configures an <code>ev_io</code> watcher. The fd is the file descriptor to rceeive 556 <p>Configures an <code>ev_io</code> watcher. The fd is the file descriptor to rceeive
551events for and events is either <code>EV_READ</code>, <code>EV_WRITE</code> or <code>EV_READ | 557events for and events is either <code>EV_READ</code>, <code>EV_WRITE</code> or <code>EV_READ |
552EV_WRITE</code> to receive the given events.</p> 558EV_WRITE</code> to receive the given events.</p>
559 <p>Please note that most of the more scalable backend mechanisms (for example
560epoll and solaris ports) can result in spurious readyness notifications
561for file descriptors, so you practically need to use non-blocking I/O (and
562treat callback invocation as hint only), or retest separately with a safe
563interface before doing I/O (XLib can do this), or force the use of either
564<code>EVBACKEND_SELECT</code> or <code>EVBACKEND_POLL</code>, which don't suffer from this
565problem. Also note that it is quite easy to have your callback invoked
566when the readyness condition is no longer valid even when employing
567typical ways of handling events, so its a good idea to use non-blocking
568I/O unconditionally.</p>
553 </dd> 569 </dd>
554</dl> 570</dl>
555 571
556</div> 572</div>
557<h2 id="code_ev_timer_code_relative_and_opti"><code>ev_timer</code> - relative and optionally recurring timeouts</h2> 573<h2 id="code_ev_timer_code_relative_and_opti"><code>ev_timer</code> - relative and optionally recurring timeouts</h2>

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines