ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libev/ev.pod
(Generate patch)

Comparing libev/ev.pod (file contents):
Revision 1.45 by root, Mon Nov 26 09:52:09 2007 UTC vs.
Revision 1.47 by root, Mon Nov 26 19:49:36 2007 UTC

1160 1160
1161 static void 1161 static void
1162 io_cb (ev_loop *loop, ev_io *w, int revents) 1162 io_cb (ev_loop *loop, ev_io *w, int revents)
1163 { 1163 {
1164 // set the relevant poll flags 1164 // set the relevant poll flags
1165 // could also call adns_processreadable etc. here
1165 struct pollfd *fd = (struct pollfd *)w->data; 1166 struct pollfd *fd = (struct pollfd *)w->data;
1166 if (revents & EV_READ ) fd->revents |= fd->events & POLLIN; 1167 if (revents & EV_READ ) fd->revents |= fd->events & POLLIN;
1167 if (revents & EV_WRITE) fd->revents |= fd->events & POLLOUT; 1168 if (revents & EV_WRITE) fd->revents |= fd->events & POLLOUT;
1168 } 1169 }
1169 1170
1699will have the C<struct ev_loop *> as first argument, and you can create 1700will have the C<struct ev_loop *> as first argument, and you can create
1700additional independent event loops. Otherwise there will be no support 1701additional independent event loops. Otherwise there will be no support
1701for multiple event loops and there is no first event loop pointer 1702for multiple event loops and there is no first event loop pointer
1702argument. Instead, all functions act on the single default loop. 1703argument. Instead, all functions act on the single default loop.
1703 1704
1704=item EV_PERIODICS 1705=item EV_PERIODIC_ENABLE
1705 1706
1706If undefined or defined to be C<1>, then periodic timers are supported, 1707If undefined or defined to be C<1>, then periodic timers are supported. If
1707otherwise not. This saves a few kb of code. 1708defined to be C<0>, then they are not. Disabling them saves a few kB of
1709code.
1710
1711=item EV_EMBED_ENABLE
1712
1713If undefined or defined to be C<1>, then embed watchers are supported. If
1714defined to be C<0>, then they are not.
1715
1716=item EV_STAT_ENABLE
1717
1718If undefined or defined to be C<1>, then stat watchers are supported. If
1719defined to be C<0>, then they are not.
1720
1721=item EV_MINIMAL
1722
1723If you need to shave off some kilobytes of code at the expense of some
1724speed, define this symbol to C<1>. Currently only used for gcc to override
1725some inlining decisions, saves roughly 30% codesize of amd64.
1708 1726
1709=item EV_COMMON 1727=item EV_COMMON
1710 1728
1711By default, all watchers have a C<void *data> member. By redefining 1729By default, all watchers have a C<void *data> member. By redefining
1712this macro to a something else you can include more and other types of 1730this macro to a something else you can include more and other types of
1755And a F<ev_cpp.C> implementation file that contains libev proper and is compiled: 1773And a F<ev_cpp.C> implementation file that contains libev proper and is compiled:
1756 1774
1757 #include "ev_cpp.h" 1775 #include "ev_cpp.h"
1758 #include "ev.c" 1776 #include "ev.c"
1759 1777
1778
1779=head1 COMPLEXITIES
1780
1781In this section the complexities of (many of) the algorithms used inside
1782libev will be explained. For complexity discussions about backends see the
1783documentation for C<ev_default_init>.
1784
1785=over 4
1786
1787=item Starting and stopping timer/periodic watchers: O(log skipped_other_timers)
1788
1789=item Changing timer/periodic watchers (by autorepeat, again): O(log skipped_other_timers)
1790
1791=item Starting io/check/prepare/idle/signal/child watchers: O(1)
1792
1793=item Stopping check/prepare/idle watchers: O(1)
1794
1795=item Stopping an io/signal/child watcher: O(number_of_watchers_for_this_(fd/signal/pid % 16))
1796
1797=item Finding the next timer per loop iteration: O(1)
1798
1799=item Each change on a file descriptor per loop iteration: O(number_of_watchers_for_this_fd)
1800
1801=item Activating one watcher: O(1)
1802
1803=back
1804
1805
1760=head1 AUTHOR 1806=head1 AUTHOR
1761 1807
1762Marc Lehmann <libev@schmorp.de>. 1808Marc Lehmann <libev@schmorp.de>.
1763 1809

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines