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

Comparing libev/ev.pod (file contents):
Revision 1.115 by root, Mon Dec 31 01:32:59 2007 UTC vs.
Revision 1.117 by root, Wed Jan 9 04:15:39 2008 UTC

403While this backend scales well, it requires one system call per active 403While this backend scales well, it requires one system call per active
404file descriptor per loop iteration. For small and medium numbers of file 404file descriptor per loop iteration. For small and medium numbers of file
405descriptors a "slow" C<EVBACKEND_SELECT> or C<EVBACKEND_POLL> backend 405descriptors a "slow" C<EVBACKEND_SELECT> or C<EVBACKEND_POLL> backend
406might perform better. 406might perform better.
407 407
408On the positive side, ignoring the spurious readyness notifications, this
409backend actually performed to specification in all tests and is fully
410embeddable, which is a rare feat among the OS-specific backends.
411
408=item C<EVBACKEND_ALL> 412=item C<EVBACKEND_ALL>
409 413
410Try all backends (even potentially broken ones that wouldn't be tried 414Try all backends (even potentially broken ones that wouldn't be tried
411with C<EVFLAG_AUTO>). Since this is a mask, you can do stuff such as 415with C<EVFLAG_AUTO>). Since this is a mask, you can do stuff such as
412C<EVBACKEND_ALL & ~EVBACKEND_KQUEUE>. 416C<EVBACKEND_ALL & ~EVBACKEND_KQUEUE>.
414It is definitely not recommended to use this flag. 418It is definitely not recommended to use this flag.
415 419
416=back 420=back
417 421
418If one or more of these are ored into the flags value, then only these 422If one or more of these are ored into the flags value, then only these
419backends will be tried (in the reverse order as given here). If none are 423backends will be tried (in the reverse order as listed here). If none are
420specified, most compiled-in backend will be tried, usually in reverse 424specified, all backends in C<ev_recommended_backends ()> will be tried.
421order of their flag values :)
422 425
423The most typical usage is like this: 426The most typical usage is like this:
424 427
425 if (!ev_default_loop (0)) 428 if (!ev_default_loop (0))
426 fatal ("could not initialise libev, bad $LIBEV_FLAGS in environment?"); 429 fatal ("could not initialise libev, bad $LIBEV_FLAGS in environment?");
605returning, ev_unref() after starting, and ev_ref() before stopping it. For 608returning, ev_unref() after starting, and ev_ref() before stopping it. For
606example, libev itself uses this for its internal signal pipe: It is not 609example, libev itself uses this for its internal signal pipe: It is not
607visible to the libev user and should not keep C<ev_loop> from exiting if 610visible to the libev user and should not keep C<ev_loop> from exiting if
608no event watchers registered by it are active. It is also an excellent 611no event watchers registered by it are active. It is also an excellent
609way to do this for generic recurring timers or from within third-party 612way to do this for generic recurring timers or from within third-party
610libraries. Just remember to I<unref after start> and I<ref before stop>. 613libraries. Just remember to I<unref after start> and I<ref before stop>
614(but only if the watcher wasn't active before, or was active before,
615respectively).
611 616
612Example: Create a signal watcher, but keep it from keeping C<ev_loop> 617Example: Create a signal watcher, but keep it from keeping C<ev_loop>
613running when nothing else is active. 618running when nothing else is active.
614 619
615 struct ev_signal exitsig; 620 struct ev_signal exitsig;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines