--- cvsroot/EV/Makefile.PL 2007/11/01 17:45:30 1.13 +++ cvsroot/EV/Makefile.PL 2007/11/04 16:43:53 1.15 @@ -36,14 +36,12 @@ *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** -POSIX optionally offers support for a monotonic clock source. EV can -take advantage of this clock source to detect time jumps reliably. This -will usually slow down EV a tiny amount, but this is usually -well-invested. Unfortunately, some systems are bound to be broken, so -you can disable this here. Whatever your reasons, you can completely -disable the detection and use of this monotonic clock by answering 'n' -here. Support for this clock type will otherwise be autodetected at both -compile- and runtime. +POSIX optionally offers support for a monotonic clock source. EV +can take advantage of this clock source to detect time jumps +reliably. Unfortunately, some systems are bound to be broken, so you can +disable this here: you can completely disable the detection and use of +the monotonic clock by answering 'n' here. Support for this clock type +will otherwise be autodetected at both compile- and runtime. EOF @@ -74,14 +72,37 @@ *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** -EV needs the functions pthread_atfork and clock_gettime. On most systems -you need some special libraries for this (such as -lrt and -lpthread). You can -specify additional libraries to provide these calls now, or accept the default. +EV by default uses select, which makes it hard to write efficient servers, +especially if the number of active conencitons is much lower than the open +ones. GNU/Linux systems have a more scalable method called "epoll", which +EV can use. For this to work, both your kernel and glibc have to support +epoll, but if you can compile it, the detection will be done at runtime, +and EV will safely fall back to using select when epoll isn't available. +If unsure, accept the default. EOF -$LIBS = prompt "Extra libraries for pthread_atfork and clock_gettime?", "-lpthread -lrt"; +if (prompt ("Enable epoll backend (y/n)?", (-e "/usr/include/sys/epoll.h") ? "y" : "n") =~ /[yY]/) { + $DEFINE .= " -DEV_USE_EPOLL"; +} + +print <