From 756a6378f76a80c595335d4a78ab426cc44d247d Mon Sep 17 00:00:00 2001 From: root Date: Thu, 29 Nov 2007 17:28:13 +0000 Subject: implement EVFLAG_FORKCHECK --- ev.html | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'ev.html') diff --git a/ev.html b/ev.html index 08d84d5..5ca899a 100644 --- a/ev.html +++ b/ev.html @@ -6,7 +6,7 @@ - + @@ -327,6 +327,23 @@ or setgid) then libev will not 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.

+ +
EVFLAG_FORKCHECK
+
+

Instead of calling ev_default_fork or ev_loop_fork manually after +a fork, you can also make libev check for a fork in each iteration by +enabling this flag.

+

This works by calling getpid () 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, getpid is actually a simple 5-insn sequence +without a syscall and thus very fast, but my Linux system also has +pthread_atfork which is even faster).

+

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.

+

This flag setting cannot be overriden or specified in the LIBEV_FLAGS +environment variable.

EVBACKEND_SELECT (value 1, portable select backend)
-- cgit v1.2.3