… | |
… | |
689 | interval to a value near C<0.1> or so, which is often enough for |
689 | interval to a value near C<0.1> or so, which is often enough for |
690 | interactive servers (of course not for games), likewise for timeouts. It |
690 | interactive servers (of course not for games), likewise for timeouts. It |
691 | usually doesn't make much sense to set it to a lower value than C<0.01>, |
691 | usually doesn't make much sense to set it to a lower value than C<0.01>, |
692 | as this approsaches the timing granularity of most systems. |
692 | as this approsaches the timing granularity of most systems. |
693 | |
693 | |
|
|
694 | =item ev_loop_verify (loop) |
|
|
695 | |
|
|
696 | This function only does something when C<EV_VERIFY> support has been |
|
|
697 | compiled in. It tries to go through all internal structures and checks |
|
|
698 | them for validity. If anything is found to be inconsistent, it will print |
|
|
699 | an error message to standard error and call C<abort ()>. |
|
|
700 | |
|
|
701 | This can be used to catch bugs inside libev itself: under normal |
|
|
702 | circumstances, this function will never abort as of course libev keeps its |
|
|
703 | data structures consistent. |
|
|
704 | |
694 | =back |
705 | =back |
695 | |
706 | |
696 | |
707 | |
697 | =head1 ANATOMY OF A WATCHER |
708 | =head1 ANATOMY OF A WATCHER |
698 | |
709 | |
… | |
… | |
1332 | time where C<time = at (mod interval)>, regardless of any time jumps. |
1343 | time where C<time = at (mod interval)>, regardless of any time jumps. |
1333 | |
1344 | |
1334 | For numerical stability it is preferable that the C<at> value is near |
1345 | For numerical stability it is preferable that the C<at> value is near |
1335 | C<ev_now ()> (the current time), but there is no range requirement for |
1346 | C<ev_now ()> (the current time), but there is no range requirement for |
1336 | this value, and in fact is often specified as zero. |
1347 | this value, and in fact is often specified as zero. |
|
|
1348 | |
|
|
1349 | Note also that there is an upper limit to how often a timer can fire (cpu |
|
|
1350 | speed for example), so if C<interval> is very small then timing stability |
|
|
1351 | will of course detoriate. Libev itself tries to be exact to be about one |
|
|
1352 | millisecond (if the OS supports it and the machine is fast enough). |
1337 | |
1353 | |
1338 | =item * manual reschedule mode (at and interval ignored, reschedule_cb = callback) |
1354 | =item * manual reschedule mode (at and interval ignored, reschedule_cb = callback) |
1339 | |
1355 | |
1340 | In this mode the values for C<interval> and C<at> are both being |
1356 | In this mode the values for C<interval> and C<at> are both being |
1341 | ignored. Instead, each time the periodic watcher gets scheduled, the |
1357 | ignored. Instead, each time the periodic watcher gets scheduled, the |
… | |
… | |
3026 | noticably with with many (hundreds) of watchers. |
3042 | noticably with with many (hundreds) of watchers. |
3027 | |
3043 | |
3028 | The default is C<1> unless C<EV_MINIMAL> is set in which case it is C<0> |
3044 | The default is C<1> unless C<EV_MINIMAL> is set in which case it is C<0> |
3029 | (disabled). |
3045 | (disabled). |
3030 | |
3046 | |
|
|
3047 | =item EV_VERIFY |
|
|
3048 | |
|
|
3049 | Controls how much internal verification (see C<ev_loop_verify ()>) will |
|
|
3050 | be done: If set to C<0>, no internal verification code will be compiled |
|
|
3051 | in. If set to C<1>, then verification code will be compiled in, but not |
|
|
3052 | called. If set to C<2>, then the internal verification code will be |
|
|
3053 | called once per loop, which can slow down libev. If set to C<3>, then the |
|
|
3054 | verification code will be called very frequently, which will slow down |
|
|
3055 | libev considerably. |
|
|
3056 | |
|
|
3057 | The default is C<1>, unless C<EV_MINIMAL> is set, in which case it will be |
|
|
3058 | C<0.> |
|
|
3059 | |
3031 | =item EV_COMMON |
3060 | =item EV_COMMON |
3032 | |
3061 | |
3033 | By default, all watchers have a C<void *data> member. By redefining |
3062 | By default, all watchers have a C<void *data> member. By redefining |
3034 | this macro to a something else you can include more and other types of |
3063 | this macro to a something else you can include more and other types of |
3035 | members. You have to define it each time you include one of the files, |
3064 | members. You have to define it each time you include one of the files, |