… | |
… | |
596 | overhead for the actual polling but can deliver many events at once. |
596 | overhead for the actual polling but can deliver many events at once. |
597 | |
597 | |
598 | By setting a higher I<io collect interval> you allow libev to spend more |
598 | By setting a higher I<io collect interval> you allow libev to spend more |
599 | time collecting I/O events, so you can handle more events per iteration, |
599 | time collecting I/O events, so you can handle more events per iteration, |
600 | at the cost of increasing latency. Timeouts (both C<ev_periodic> and |
600 | at the cost of increasing latency. Timeouts (both C<ev_periodic> and |
601 | C<ev_timer>) will be not affected. |
601 | C<ev_timer>) will be not affected. Setting this to a non-null bvalue will |
|
|
602 | introduce an additional C<ev_sleep ()> call into most loop iterations. |
602 | |
603 | |
603 | Likewise, by setting a higher I<timeout collect interval> you allow libev |
604 | Likewise, by setting a higher I<timeout collect interval> you allow libev |
604 | to spend more time collecting timeouts, at the expense of increased |
605 | to spend more time collecting timeouts, at the expense of increased |
605 | latency (the watcher callback will be called later). C<ev_io> watchers |
606 | latency (the watcher callback will be called later). C<ev_io> watchers |
606 | will not be affected. |
607 | will not be affected. Setting this to a non-null value will not introduce |
|
|
608 | any overhead in libev. |
607 | |
609 | |
608 | Many programs can usually benefit by setting the io collect interval to |
610 | Many (busy) programs can usually benefit by setting the io collect |
609 | a value near C<0.1> or so, which is often enough for interactive servers |
611 | interval to a value near C<0.1> or so, which is often enough for |
610 | (of course not for games), likewise for timeouts. It usually doesn't make |
612 | interactive servers (of course not for games), likewise for timeouts. It |
611 | much sense to set it to a lower value than C<0.01>, as this approsaches |
613 | usually doesn't make much sense to set it to a lower value than C<0.01>, |
612 | the timing granularity of most systems. |
614 | as this approsaches the timing granularity of most systems. |
613 | |
615 | |
614 | =back |
616 | =back |
615 | |
617 | |
616 | |
618 | |
617 | =head1 ANATOMY OF A WATCHER |
619 | =head1 ANATOMY OF A WATCHER |