diff options
-rw-r--r-- | ev.3 | 29 | ||||
-rw-r--r-- | ev.html | 30 | ||||
-rw-r--r-- | ev.pod | 29 |
3 files changed, 86 insertions, 2 deletions
@@ -1297,11 +1297,12 @@ pseudo-code only of course: \& static ev_timer tw; .Ve .PP -.Vb 8 +.Vb 9 \& static void \& io_cb (ev_loop *loop, ev_io *w, int revents) \& { \& // set the relevant poll flags +\& // could also call adns_processreadable etc. here \& struct pollfd *fd = (struct pollfd *)w->data; \& if (revents & EV_READ ) fd->revents |= fd->events & POLLIN; \& if (revents & EV_WRITE) fd->revents |= fd->events & POLLOUT; @@ -1902,6 +1903,32 @@ And a \fIev_cpp.C\fR implementation file that contains libev proper and is compi \& #include "ev_cpp.h" \& #include "ev.c" .Ve +.SH "COMPLEXITIES" +.IX Header "COMPLEXITIES" +In this section the complexities of (many of) the algorithms used inside +libev will be explained. For complexity discussions about backends see the +documentation for \f(CW\*(C`ev_default_init\*(C'\fR. +.RS 4 +.IP "Starting and stopping timer/periodic watchers: O(log skipped_other_timers)" 4 +.IX Item "Starting and stopping timer/periodic watchers: O(log skipped_other_timers)" +.PD 0 +.IP "Changing timer/periodic watchers (by autorepeat, again): O(log skipped_other_timers)" 4 +.IX Item "Changing timer/periodic watchers (by autorepeat, again): O(log skipped_other_timers)" +.IP "Starting io/check/prepare/idle/signal/child watchers: O(1)" 4 +.IX Item "Starting io/check/prepare/idle/signal/child watchers: O(1)" +.IP "Stopping check/prepare/idle watchers: O(1)" 4 +.IX Item "Stopping check/prepare/idle watchers: O(1)" +.IP "Stopping an io/signal/child watcher: O(number_of_watchers_for_this_(fd/signal/pid % 16))" 4 +.IX Item "Stopping an io/signal/child watcher: O(number_of_watchers_for_this_(fd/signal/pid % 16))" +.IP "Finding the next timer per loop iteration: O(1)" 4 +.IX Item "Finding the next timer per loop iteration: O(1)" +.IP "Each change on a file descriptor per loop iteration: O(number_of_watchers_for_this_fd)" 4 +.IX Item "Each change on a file descriptor per loop iteration: O(number_of_watchers_for_this_fd)" +.IP "Activating one watcher: O(1)" 4 +.IX Item "Activating one watcher: O(1)" +.RE +.RS 4 +.PD .SH "AUTHOR" .IX Header "AUTHOR" Marc Lehmann <libev@schmorp.de>. @@ -6,7 +6,7 @@ <meta name="description" content="Pod documentation for libev" /> <meta name="inputfile" content="<standard input>" /> <meta name="outputfile" content="<standard output>" /> - <meta name="created" content="Mon Nov 26 10:52:13 2007" /> + <meta name="created" content="Mon Nov 26 11:20:35 2007" /> <meta name="generator" content="Pod::Xhtml 1.57" /> <link rel="stylesheet" href="http://res.tst.eu/pod.css"/></head> <body> @@ -52,6 +52,7 @@ <li><a href="#EXAMPLES">EXAMPLES</a></li> </ul> </li> +<li><a href="#COMPLEXITIES">COMPLEXITIES</a></li> <li><a href="#AUTHOR">AUTHOR</a> </li> </ul><hr /> @@ -1178,6 +1179,7 @@ pseudo-code only of course:</p> io_cb (ev_loop *loop, ev_io *w, int revents) { // set the relevant poll flags + // could also call adns_processreadable etc. here struct pollfd *fd = (struct pollfd *)w->data; if (revents & EV_READ ) fd->revents |= fd->events & POLLIN; if (revents & EV_WRITE) fd->revents |= fd->events & POLLOUT; @@ -1755,9 +1757,35 @@ that everybody includes and which overrides some autoconf choices:</p> <pre> #include "ev_cpp.h" #include "ev.c" + + + </pre> </div> +<h1 id="COMPLEXITIES">COMPLEXITIES</h1><p><a href="#TOP" class="toplink">Top</a></p> +<div id="COMPLEXITIES_CONTENT"> + <p>In this section the complexities of (many of) the algorithms used inside +libev will be explained. For complexity discussions about backends see the +documentation for <code>ev_default_init</code>.</p> + <p> + <dl> + <dt>Starting and stopping timer/periodic watchers: O(log skipped_other_timers)</dt> + <dt>Changing timer/periodic watchers (by autorepeat, again): O(log skipped_other_timers)</dt> + <dt>Starting io/check/prepare/idle/signal/child watchers: O(1)</dt> + <dt>Stopping check/prepare/idle watchers: O(1)</dt> + <dt>Stopping an io/signal/child watcher: O(number_of_watchers_for_this_(fd/signal/pid % 16))</dt> + <dt>Finding the next timer per loop iteration: O(1)</dt> + <dt>Each change on a file descriptor per loop iteration: O(number_of_watchers_for_this_fd)</dt> + <dt>Activating one watcher: O(1)</dt> + </dl> + </p> + + + + + +</div> <h1 id="AUTHOR">AUTHOR</h1><p><a href="#TOP" class="toplink">Top</a></p> <div id="AUTHOR_CONTENT"> <p>Marc Lehmann <libev@schmorp.de>.</p> @@ -1162,6 +1162,7 @@ pseudo-code only of course: io_cb (ev_loop *loop, ev_io *w, int revents) { // set the relevant poll flags + // could also call adns_processreadable etc. here struct pollfd *fd = (struct pollfd *)w->data; if (revents & EV_READ ) fd->revents |= fd->events & POLLIN; if (revents & EV_WRITE) fd->revents |= fd->events & POLLOUT; @@ -1757,6 +1758,34 @@ And a F<ev_cpp.C> implementation file that contains libev proper and is compiled #include "ev_cpp.h" #include "ev.c" + +=head1 COMPLEXITIES + +In this section the complexities of (many of) the algorithms used inside +libev will be explained. For complexity discussions about backends see the +documentation for C<ev_default_init>. + +=over 4 + +=item Starting and stopping timer/periodic watchers: O(log skipped_other_timers) + +=item Changing timer/periodic watchers (by autorepeat, again): O(log skipped_other_timers) + +=item Starting io/check/prepare/idle/signal/child watchers: O(1) + +=item Stopping check/prepare/idle watchers: O(1) + +=item Stopping an io/signal/child watcher: O(number_of_watchers_for_this_(fd/signal/pid % 16)) + +=item Finding the next timer per loop iteration: O(1) + +=item Each change on a file descriptor per loop iteration: O(number_of_watchers_for_this_fd) + +=item Activating one watcher: O(1) + +=back + + =head1 AUTHOR Marc Lehmann <libev@schmorp.de>. |