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

Comparing libev/ev.pod (file contents):
Revision 1.247 by root, Wed Jul 8 02:46:05 2009 UTC vs.
Revision 1.250 by root, Thu Jul 9 09:11:20 2009 UTC

1492 1492
1493The callback is guaranteed to be invoked only I<after> its timeout has 1493The callback is guaranteed to be invoked only I<after> its timeout has
1494passed (not I<at>, so on systems with very low-resolution clocks this 1494passed (not I<at>, so on systems with very low-resolution clocks this
1495might introduce a small delay). If multiple timers become ready during the 1495might introduce a small delay). If multiple timers become ready during the
1496same loop iteration then the ones with earlier time-out values are invoked 1496same loop iteration then the ones with earlier time-out values are invoked
1497before ones with later time-out values (but this is no longer true when a 1497before ones of the same priority with later time-out values (but this is
1498callback calls C<ev_loop> recursively). 1498no longer true when a callback calls C<ev_loop> recursively).
1499 1499
1500=head3 Be smart about timeouts 1500=head3 Be smart about timeouts
1501 1501
1502Many real-world problems involve some kind of timeout, usually for error 1502Many real-world problems involve some kind of timeout, usually for error
1503recovery. A typical example is an HTTP request - if the other side hangs, 1503recovery. A typical example is an HTTP request - if the other side hangs,
2031but forking and registering a watcher a few event loop iterations later or 2031but forking and registering a watcher a few event loop iterations later or
2032in the next callback invocation is not. 2032in the next callback invocation is not.
2033 2033
2034Only the default event loop is capable of handling signals, and therefore 2034Only the default event loop is capable of handling signals, and therefore
2035you can only register child watchers in the default event loop. 2035you can only register child watchers in the default event loop.
2036
2037Due to some design glitches inside libev, child watchers will always be
2038handled at maximum priority (their priority is set to C<EV_MAXPRI> by
2039libev)
2036 2040
2037=head3 Process Interaction 2041=head3 Process Interaction
2038 2042
2039Libev grabs C<SIGCHLD> as soon as the default event loop is 2043Libev grabs C<SIGCHLD> as soon as the default event loop is
2040initialised. This is necessary to guarantee proper behaviour even if 2044initialised. This is necessary to guarantee proper behaviour even if
3667defined to be C<0>, then they are not. 3671defined to be C<0>, then they are not.
3668 3672
3669=item EV_MINIMAL 3673=item EV_MINIMAL
3670 3674
3671If you need to shave off some kilobytes of code at the expense of some 3675If you need to shave off some kilobytes of code at the expense of some
3672speed, define this symbol to C<1>. Currently this is used to override some 3676speed (but with the full API), define this symbol to C<1>. Currently this
3673inlining decisions, saves roughly 30% code size on amd64. It also selects a 3677is used to override some inlining decisions, saves roughly 30% code size
3674much smaller 2-heap for timer management over the default 4-heap. 3678on amd64. It also selects a much smaller 2-heap for timer management over
3679the default 4-heap.
3680
3681You can save even more by disabling watcher types you do not need and
3682setting C<EV_MAXPRI> == C<EV_MINPRI>.
3675 3683
3676=item EV_PID_HASHSIZE 3684=item EV_PID_HASHSIZE
3677 3685
3678C<ev_child> watchers use a small hash table to distribute workload by 3686C<ev_child> watchers use a small hash table to distribute workload by
3679pid. The default size is C<16> (or C<1> with C<EV_MINIMAL>), usually more 3687pid. The default size is C<16> (or C<1> with C<EV_MINIMAL>), usually more

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines