summaryrefslogtreecommitdiff
path: root/ev.3
diff options
context:
space:
mode:
authorroot <root>2007-11-29 17:28:13 +0000
committerroot <root>2007-11-29 17:28:13 +0000
commit756a6378f76a80c595335d4a78ab426cc44d247d (patch)
tree8dfc566a50d530e4c5ca45a2ee3f97e47b314927 /ev.3
parent8d0f4d263d9a5601bb7d419e7db00970e288cb7e (diff)
implement EVFLAG_FORKCHECK
Diffstat (limited to 'ev.3')
-rw-r--r--ev.320
1 files changed, 20 insertions, 0 deletions
diff --git a/ev.3 b/ev.3
index d7652a3..cf2a42d 100644
--- a/ev.3
+++ b/ev.3
@@ -413,6 +413,26 @@ or setgid) then libev will \fInot\fR look at the environment variable
override the flags completely if it is found in the environment. This is
useful to try out specific backends to test their performance, or to work
around bugs.
+.ie n .IP """EVFLAG_FORKCHECK""" 4
+.el .IP "\f(CWEVFLAG_FORKCHECK\fR" 4
+.IX Item "EVFLAG_FORKCHECK"
+Instead of calling \f(CW\*(C`ev_default_fork\*(C'\fR or \f(CW\*(C`ev_loop_fork\*(C'\fR manually after
+a fork, you can also make libev check for a fork in each iteration by
+enabling this flag.
+.Sp
+This works by calling \f(CW\*(C`getpid ()\*(C'\fR on every iteration of the loop,
+and thus this might slow down your event loop if you do a lot of loop
+iterations and little real work, but is usually not noticable (on my
+Linux system for example, \f(CW\*(C`getpid\*(C'\fR is actually a simple 5\-insn sequence
+without a syscall and thus \fIvery\fR fast, but my Linux system also has
+\&\f(CW\*(C`pthread_atfork\*(C'\fR which is even faster).
+.Sp
+The big advantage of this flag is that you can forget about fork (and
+forget about forgetting to tell libev about forking) when you use this
+flag.
+.Sp
+This flag setting cannot be overriden or specified in the \f(CW\*(C`LIBEV_FLAGS\*(C'\fR
+environment variable.
.ie n .IP """EVBACKEND_SELECT"" (value 1, portable select backend)" 4
.el .IP "\f(CWEVBACKEND_SELECT\fR (value 1, portable select backend)" 4
.IX Item "EVBACKEND_SELECT (value 1, portable select backend)"