diff options
-rw-r--r-- | ev.3 | 49 | ||||
-rw-r--r-- | ev.html | 49 | ||||
-rw-r--r-- | ev.pod | 46 | ||||
-rwxr-xr-x | import_libevent | 11 |
4 files changed, 147 insertions, 8 deletions
@@ -198,6 +198,10 @@ libev \- a high performance full\-featured event loop written in C .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" +The newest version of this document is also available as a html-formatted +web page you might find easier to navigate when reading it for the first +time: <http://cvs.schmorp.de/libev/ev.html>. +.PP Libev is an event loop: you register interest in certain events (such as a file descriptor being readable or a timeout occuring), and it will manage these event sources and provide your program with events. @@ -2276,6 +2280,24 @@ will have the \f(CW\*(C`struct ev_loop *\*(C'\fR as first argument, and you can additional independent event loops. Otherwise there will be no support for multiple event loops and there is no first event loop pointer argument. Instead, all functions act on the single default loop. +.IP "\s-1EV_MINPRI\s0" 4 +.IX Item "EV_MINPRI" +.PD 0 +.IP "\s-1EV_MAXPRI\s0" 4 +.IX Item "EV_MAXPRI" +.PD +The range of allowed priorities. \f(CW\*(C`EV_MINPRI\*(C'\fR must be smaller or equal to +\&\f(CW\*(C`EV_MAXPRI\*(C'\fR, but otherwise there are no non-obvious limitations. You can +provide for more priorities by overriding those symbols (usually defined +to be \f(CW\*(C`\-2\*(C'\fR and \f(CW2\fR, respectively). +.Sp +When doing priority-based operations, libev usually has to linearly search +all the priorities, so having many of them (hundreds) uses a lot of space +and time, so using the defaults of five priorities (\-2 .. +2) is usually +fine. +.Sp +If your embedding app does not need any priorities, defining these both to +\&\f(CW0\fR will save some memory and cpu. .IP "\s-1EV_PERIODIC_ENABLE\s0" 4 .IX Item "EV_PERIODIC_ENABLE" If undefined or defined to be \f(CW1\fR, then periodic timers are supported. If @@ -2387,24 +2409,47 @@ 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 +This means that, when you have a watcher that triggers in one hour and +there are 100 watchers that would trigger before that then inserting will +have to skip those 100 watchers. .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)" +That means that for changing a timer costs less than removing/adding them +as only the relative motion in the event queue has to be paid for. .IP "Starting io/check/prepare/idle/signal/child watchers: O(1)" 4 .IX Item "Starting io/check/prepare/idle/signal/child watchers: O(1)" +These just add the watcher into an array or at the head of a list. If +the array needs to be extended libev needs to realloc and move the whole +array, but this happen asymptotically less and less with more watchers, +thus amortised O(1). .IP "Stopping check/prepare/idle watchers: O(1)" 4 .IX Item "Stopping check/prepare/idle watchers: O(1)" +.PD 0 .IP "Stopping an io/signal/child watcher: O(number_of_watchers_for_this_(fd/signal/pid % \s-1EV_PID_HASHSIZE\s0))" 4 .IX Item "Stopping an io/signal/child watcher: O(number_of_watchers_for_this_(fd/signal/pid % EV_PID_HASHSIZE))" +.PD +These watchers are stored in lists then need to be walked to find the +correct watcher to remove. The lists are usually short (you don't usually +have many watchers waiting for the same fd or signal). .IP "Finding the next timer per loop iteration: O(1)" 4 .IX Item "Finding the next timer per loop iteration: O(1)" +.PD 0 .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)" +.PD +A change means an I/O watcher gets started or stopped, which requires +libev to recalculate its status (and possibly tell the kernel). .IP "Activating one watcher: O(1)" 4 .IX Item "Activating one watcher: O(1)" +.PD 0 +.IP "Priority handling: O(number_of_priorities)" 4 +.IX Item "Priority handling: O(number_of_priorities)" +.PD +Priorities are implemented by allocating some space for each +priority. When doing priority-based operations, libev usually has to +linearly search all the priorities. .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="Fri Dec 7 19:03:06 2007" /> + <meta name="created" content="Fri Dec 7 20:07:44 2007" /> <meta name="generator" content="Pod::Xhtml 1.57" /> <link rel="stylesheet" href="http://res.tst.eu/pod.css"/></head> <body> @@ -121,6 +121,9 @@ </div> <h1 id="DESCRIPTION">DESCRIPTION</h1> <div id="DESCRIPTION_CONTENT"> +<p>The newest version of this document is also available as a html-formatted +web page you might find easier to navigate when reading it for the first +time: <a href="http://cvs.schmorp.de/libev/ev.html">http://cvs.schmorp.de/libev/ev.html</a>.</p> <p>Libev is an event loop: you register interest in certain events (such as a file descriptor being readable or a timeout occuring), and it will manage these event sources and provide your program with events.</p> @@ -2112,6 +2115,20 @@ additional independent event loops. Otherwise there will be no support for multiple event loops and there is no first event loop pointer argument. Instead, all functions act on the single default loop.</p> </dd> + <dt>EV_MINPRI</dt> + <dt>EV_MAXPRI</dt> + <dd> + <p>The range of allowed priorities. <code>EV_MINPRI</code> must be smaller or equal to +<code>EV_MAXPRI</code>, but otherwise there are no non-obvious limitations. You can +provide for more priorities by overriding those symbols (usually defined +to be <code>-2</code> and <code>2</code>, respectively).</p> + <p>When doing priority-based operations, libev usually has to linearly search +all the priorities, so having many of them (hundreds) uses a lot of space +and time, so using the defaults of five priorities (-2 .. +2) is usually +fine.</p> + <p>If your embedding app does not need any priorities, defining these both to +<code>0</code> will save some memory and cpu.</p> + </dd> <dt>EV_PERIODIC_ENABLE</dt> <dd> <p>If undefined or defined to be <code>1</code>, then periodic timers are supported. If @@ -2227,13 +2244,43 @@ documentation for <code>ev_default_init</code>.</p> <p> <dl> <dt>Starting and stopping timer/periodic watchers: O(log skipped_other_timers)</dt> + <dd> + <p>This means that, when you have a watcher that triggers in one hour and +there are 100 watchers that would trigger before that then inserting will +have to skip those 100 watchers.</p> + </dd> <dt>Changing timer/periodic watchers (by autorepeat, again): O(log skipped_other_timers)</dt> + <dd> + <p>That means that for changing a timer costs less than removing/adding them +as only the relative motion in the event queue has to be paid for.</p> + </dd> <dt>Starting io/check/prepare/idle/signal/child watchers: O(1)</dt> + <dd> + <p>These just add the watcher into an array or at the head of a list. If +the array needs to be extended libev needs to realloc and move the whole +array, but this happen asymptotically less and less with more watchers, +thus amortised O(1).</p> + </dd> <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 % EV_PID_HASHSIZE))</dt> + <dd> + <p>These watchers are stored in lists then need to be walked to find the +correct watcher to remove. The lists are usually short (you don't usually +have many watchers waiting for the same fd or signal).</p> + </dd> <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> + <dd> + <p>A change means an I/O watcher gets started or stopped, which requires +libev to recalculate its status (and possibly tell the kernel).</p> + </dd> <dt>Activating one watcher: O(1)</dt> + <dt>Priority handling: O(number_of_priorities)</dt> + <dd> + <p>Priorities are implemented by allocating some space for each +priority. When doing priority-based operations, libev usually has to +linearly search all the priorities.</p> + </dd> </dl> </p> @@ -50,6 +50,10 @@ libev - a high performance full-featured event loop written in C =head1 DESCRIPTION +The newest version of this document is also available as a html-formatted +web page you might find easier to navigate when reading it for the first +time: L<http://cvs.schmorp.de/libev/ev.html>. + Libev is an event loop: you register interest in certain events (such as a file descriptor being readable or a timeout occuring), and it will manage these event sources and provide your program with events. @@ -2125,6 +2129,23 @@ additional independent event loops. Otherwise there will be no support for multiple event loops and there is no first event loop pointer argument. Instead, all functions act on the single default loop. +=item EV_MINPRI + +=item EV_MAXPRI + +The range of allowed priorities. C<EV_MINPRI> must be smaller or equal to +C<EV_MAXPRI>, but otherwise there are no non-obvious limitations. You can +provide for more priorities by overriding those symbols (usually defined +to be C<-2> and C<2>, respectively). + +When doing priority-based operations, libev usually has to linearly search +all the priorities, so having many of them (hundreds) uses a lot of space +and time, so using the defaults of five priorities (-2 .. +2) is usually +fine. + +If your embedding app does not need any priorities, defining these both to +C<0> will save some memory and cpu. + =item EV_PERIODIC_ENABLE If undefined or defined to be C<1>, then periodic timers are supported. If @@ -2240,20 +2261,45 @@ documentation for C<ev_default_init>. =item Starting and stopping timer/periodic watchers: O(log skipped_other_timers) +This means that, when you have a watcher that triggers in one hour and +there are 100 watchers that would trigger before that then inserting will +have to skip those 100 watchers. + =item Changing timer/periodic watchers (by autorepeat, again): O(log skipped_other_timers) +That means that for changing a timer costs less than removing/adding them +as only the relative motion in the event queue has to be paid for. + =item Starting io/check/prepare/idle/signal/child watchers: O(1) +These just add the watcher into an array or at the head of a list. If +the array needs to be extended libev needs to realloc and move the whole +array, but this happen asymptotically less and less with more watchers, +thus amortised 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 % EV_PID_HASHSIZE)) +These watchers are stored in lists then need to be walked to find the +correct watcher to remove. The lists are usually short (you don't usually +have many watchers waiting for the same fd or signal). + =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) +A change means an I/O watcher gets started or stopped, which requires +libev to recalculate its status (and possibly tell the kernel). + =item Activating one watcher: O(1) +=item Priority handling: O(number_of_priorities) + +Priorities are implemented by allocating some space for each +priority. When doing priority-based operations, libev usually has to +linearly search all the priorities. + =back diff --git a/import_libevent b/import_libevent index bee54d9..5d205f0 100755 --- a/import_libevent +++ b/import_libevent @@ -43,15 +43,15 @@ cp $LE/log.c . cp $LE/log.h . cp $LE/strlcpy.c . rsync -a $LE/WIN32* $LE/sample $LE/test $LE/compat . --del -rename 's/libevent/libev/' WIN32-Prj/lib* +#rename 's/libevent/libev/' WIN32-Prj/lib* cp $LE/aclocal.m4 . #cp $LE/acconfig.h . cp $LE/config.h.in . cp $LE/event_rpcgen.py . cp $LE/*.3 . -perl -i -pe 's/libevent/libev/g' sample/Makefile.am -perl -i -pe 's/libevent/libev/g' test/Makefile.am +#perl -i -pe 's/libevent/libev/g' sample/Makefile.am +#perl -i -pe 's/libevent/libev/g' test/Makefile.am perl -i -pe 's/#include <event.h>$/#include "event.h"/' test/*.c @@ -85,14 +85,15 @@ perl -ne ' s/^(include_HEADERS\s*=)/$1 ev.h event_compat.h ev++.h /; s/^(CORE_SRC\s*=)/$1 ev.c /; s/^(SYS_LIBS\s*=)/$1 -lm /; - s/libevent/libev/g; + #s/libevent/libev/g; print; ' <$LE/Makefile.am >Makefile.am perl -ne ' #s/-Wall/-Wall -Wno-comment -Wunused-function -Wno-unused-value/; s/-Wall//g; - s/libevent/libev/g; + #s/libevent/libev/g; + s/AM_INIT_AUTOMAKE\s*\(.*,(.*)\)/AM_INIT_AUTOMAKE(libevent-$1+libev,1.7)/; s/AC_LIBOBJ\(select\)/: ;/g; s/AC_LIBOBJ\(poll\)/: ;/g; s/AC_LIBOBJ\(kqueue\)/: ;/g; |