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

Comparing libev/ev.3 (file contents):
Revision 1.34 by root, Thu Nov 29 12:21:21 2007 UTC vs.
Revision 1.36 by root, Thu Nov 29 20:05:59 2007 UTC

411or setgid) then libev will \fInot\fR look at the environment variable 411or setgid) then libev will \fInot\fR look at the environment variable
412\&\f(CW\*(C`LIBEV_FLAGS\*(C'\fR. Otherwise (the default), this environment variable will 412\&\f(CW\*(C`LIBEV_FLAGS\*(C'\fR. Otherwise (the default), this environment variable will
413override the flags completely if it is found in the environment. This is 413override the flags completely if it is found in the environment. This is
414useful to try out specific backends to test their performance, or to work 414useful to try out specific backends to test their performance, or to work
415around bugs. 415around bugs.
416.ie n .IP """EVFLAG_FORKCHECK""" 4
417.el .IP "\f(CWEVFLAG_FORKCHECK\fR" 4
418.IX Item "EVFLAG_FORKCHECK"
419Instead of calling \f(CW\*(C`ev_default_fork\*(C'\fR or \f(CW\*(C`ev_loop_fork\*(C'\fR manually after
420a fork, you can also make libev check for a fork in each iteration by
421enabling this flag.
422.Sp
423This works by calling \f(CW\*(C`getpid ()\*(C'\fR on every iteration of the loop,
424and thus this might slow down your event loop if you do a lot of loop
425iterations and little real work, but is usually not noticable (on my
426Linux system for example, \f(CW\*(C`getpid\*(C'\fR is actually a simple 5\-insn sequence
427without a syscall and thus \fIvery\fR fast, but my Linux system also has
428\&\f(CW\*(C`pthread_atfork\*(C'\fR which is even faster).
429.Sp
430The big advantage of this flag is that you can forget about fork (and
431forget about forgetting to tell libev about forking) when you use this
432flag.
433.Sp
434This flag setting cannot be overriden or specified in the \f(CW\*(C`LIBEV_FLAGS\*(C'\fR
435environment variable.
416.ie n .IP """EVBACKEND_SELECT"" (value 1, portable select backend)" 4 436.ie n .IP """EVBACKEND_SELECT"" (value 1, portable select backend)" 4
417.el .IP "\f(CWEVBACKEND_SELECT\fR (value 1, portable select backend)" 4 437.el .IP "\f(CWEVBACKEND_SELECT\fR (value 1, portable select backend)" 4
418.IX Item "EVBACKEND_SELECT (value 1, portable select backend)" 438.IX Item "EVBACKEND_SELECT (value 1, portable select backend)"
419This is your standard \fIselect\fR\|(2) backend. Not \fIcompletely\fR standard, as 439This is your standard \fIselect\fR\|(2) backend. Not \fIcompletely\fR standard, as
420libev tries to roll its own fd_set with no limits on the number of fds, 440libev tries to roll its own fd_set with no limits on the number of fds,
1977.el .IP "\f(CWEV_DEFAULT\fR, \f(CWEV_DEFAULT_\fR" 4 1997.el .IP "\f(CWEV_DEFAULT\fR, \f(CWEV_DEFAULT_\fR" 4
1978.IX Item "EV_DEFAULT, EV_DEFAULT_" 1998.IX Item "EV_DEFAULT, EV_DEFAULT_"
1979Similar to the other two macros, this gives you the value of the default 1999Similar to the other two macros, this gives you the value of the default
1980loop, if multiple loops are supported (\*(L"ev loop default\*(R"). 2000loop, if multiple loops are supported (\*(L"ev loop default\*(R").
1981.PP 2001.PP
1982Example: Declare and initialise a check watcher, working regardless of 2002Example: Declare and initialise a check watcher, utilising the above
1983wether multiple loops are supported or not. 2003macros so it will work regardless of wether multiple loops are supported
2004or not.
1984.PP 2005.PP
1985.Vb 5 2006.Vb 5
1986\& static void 2007\& static void
1987\& check_cb (EV_P_ ev_timer *w, int revents) 2008\& check_cb (EV_P_ ev_timer *w, int revents)
1988\& { 2009\& {
2051.Vb 1 2072.Vb 1
2052\& ev_win32.c required on win32 platforms only 2073\& ev_win32.c required on win32 platforms only
2053.Ve 2074.Ve
2054.PP 2075.PP
2055.Vb 5 2076.Vb 5
2056\& ev_select.c only when select backend is enabled (which is by default) 2077\& ev_select.c only when select backend is enabled (which is enabled by default)
2057\& ev_poll.c only when poll backend is enabled (disabled by default) 2078\& ev_poll.c only when poll backend is enabled (disabled by default)
2058\& ev_epoll.c only when the epoll backend is enabled (disabled by default) 2079\& ev_epoll.c only when the epoll backend is enabled (disabled by default)
2059\& ev_kqueue.c only when the kqueue backend is enabled (disabled by default) 2080\& ev_kqueue.c only when the kqueue backend is enabled (disabled by default)
2060\& ev_port.c only when the solaris port backend is enabled (disabled by default) 2081\& ev_port.c only when the solaris port backend is enabled (disabled by default)
2061.Ve 2082.Ve
2288interface) and \fI\s-1EV\s0.xs\fR (implementation) files. Only the \fI\s-1EV\s0.xs\fR file 2309interface) and \fI\s-1EV\s0.xs\fR (implementation) files. Only the \fI\s-1EV\s0.xs\fR file
2289will be compiled. It is pretty complex because it provides its own header 2310will be compiled. It is pretty complex because it provides its own header
2290file. 2311file.
2291.Sp 2312.Sp
2292The usage in rxvt-unicode is simpler. It has a \fIev_cpp.h\fR header file 2313The usage in rxvt-unicode is simpler. It has a \fIev_cpp.h\fR header file
2293that everybody includes and which overrides some autoconf choices: 2314that everybody includes and which overrides some configure choices:
2294.Sp 2315.Sp
2295.Vb 4 2316.Vb 9
2317\& #define EV_MINIMAL 1
2296\& #define EV_USE_POLL 0 2318\& #define EV_USE_POLL 0
2297\& #define EV_MULTIPLICITY 0 2319\& #define EV_MULTIPLICITY 0
2298\& #define EV_PERIODICS 0 2320\& #define EV_PERIODIC_ENABLE 0
2321\& #define EV_STAT_ENABLE 0
2322\& #define EV_FORK_ENABLE 0
2299\& #define EV_CONFIG_H <config.h> 2323\& #define EV_CONFIG_H <config.h>
2324\& #define EV_MINPRI 0
2325\& #define EV_MAXPRI 0
2300.Ve 2326.Ve
2301.Sp 2327.Sp
2302.Vb 1 2328.Vb 1
2303\& #include "ev++.h" 2329\& #include "ev++.h"
2304.Ve 2330.Ve

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines