--- libev/ev.html 2007/11/26 09:52:14 1.46 +++ libev/ev.html 2007/11/26 10:20:43 1.47 @@ -6,7 +6,7 @@ - + @@ -52,6 +52,7 @@
  • EXAMPLES
  • +
  • COMPLEXITIES
  • AUTHOR

  • @@ -1178,6 +1179,7 @@ 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 @@
      #include "ev_cpp.h"
       #include "ev.c"
     
    +
    +
    +
     
    +

    COMPLEXITIES

    Top

    +
    +

    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 ev_default_init.

    +

    +

    +
    Starting and stopping timer/periodic watchers: O(log skipped_other_timers)
    +
    Changing timer/periodic watchers (by autorepeat, again): O(log skipped_other_timers)
    +
    Starting io/check/prepare/idle/signal/child watchers: O(1)
    +
    Stopping check/prepare/idle watchers: O(1)
    +
    Stopping an io/signal/child watcher: O(number_of_watchers_for_this_(fd/signal/pid % 16))
    +
    Finding the next timer per loop iteration: O(1)
    +
    Each change on a file descriptor per loop iteration: O(number_of_watchers_for_this_fd)
    +
    Activating one watcher: O(1)
    +
    +

    + + + + + +

    AUTHOR

    Top

    Marc Lehmann <libev@schmorp.de>.