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

Comparing libev/ev.pod (file contents):
Revision 1.76 by root, Sat Dec 8 15:30:30 2007 UTC vs.
Revision 1.77 by root, Sat Dec 8 22:11:14 2007 UTC

486libev watchers. However, a pair of C<ev_prepare>/C<ev_check> watchers is 486libev watchers. However, a pair of C<ev_prepare>/C<ev_check> watchers is
487usually a better approach for this kind of thing. 487usually a better approach for this kind of thing.
488 488
489Here are the gory details of what C<ev_loop> does: 489Here are the gory details of what C<ev_loop> does:
490 490
491 - Before the first iteration, call any pending watchers.
491 * If there are no active watchers (reference count is zero), return. 492 * If there are no active watchers (reference count is zero), return.
492 - Queue prepare watchers and then call all outstanding watchers. 493 - Queue all prepare watchers and then call all outstanding watchers.
493 - If we have been forked, recreate the kernel state. 494 - If we have been forked, recreate the kernel state.
494 - Update the kernel state with all outstanding changes. 495 - Update the kernel state with all outstanding changes.
495 - Update the "event loop time". 496 - Update the "event loop time".
496 - Calculate for how long to block. 497 - Calculate for how long to block.
497 - Block the process, waiting for any events. 498 - Block the process, waiting for any events.
1481with priority higher than or equal to the event loop and one coroutine 1482with priority higher than or equal to the event loop and one coroutine
1482of lower priority, but only once, using idle watchers to keep the event 1483of lower priority, but only once, using idle watchers to keep the event
1483loop from blocking if lower-priority coroutines are active, thus mapping 1484loop from blocking if lower-priority coroutines are active, thus mapping
1484low-priority coroutines to idle/background tasks). 1485low-priority coroutines to idle/background tasks).
1485 1486
1487It is recommended to give C<ev_check> watchers highest (C<EV_MAXPRI>)
1488priority, to ensure that they are being run before any other watchers
1489after the poll. Also, C<ev_check> watchers (and C<ev_prepare> watchers,
1490too) should not activate ("feed") events into libev. While libev fully
1491supports this, they will be called before other C<ev_check> watchers did
1492their job. As C<ev_check> watchers are often used to embed other event
1493loops those other event loops might be in an unusable state until their
1494C<ev_check> watcher ran (always remind yourself to coexist peacefully with
1495others).
1496
1486=over 4 1497=over 4
1487 1498
1488=item ev_prepare_init (ev_prepare *, callback) 1499=item ev_prepare_init (ev_prepare *, callback)
1489 1500
1490=item ev_check_init (ev_check *, callback) 1501=item ev_check_init (ev_check *, callback)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines