--- EV/EV.pm 2007/10/26 19:25:00 1.5
+++ EV/EV.pm 2007/10/27 07:30:10 1.6
@@ -43,7 +43,12 @@
=head1 DESCRIPTION
This module provides an interface to libevent
-(L).
+(L). You probably should acquaint
+yourself with its documentation and source code to be able to use this
+module fully.
+
+Please note thta this module disables the libevent EPOLL method by
+default, see BUGS, below, if you need to enable it.
=cut
@@ -206,10 +211,25 @@
Lots. Libevent itself isn't well tested and rather buggy, and this module
is quite new at the moment.
+Please note that the epoll method is not, in general, reliable in
+programs that use fork (even if no libveent calls are being made in the
+forked process). Since this is such a common issue, this module will
+force the epoll method in EV to be off *unless* the global variable
+$EV::ENABLE_EPOLL is set to 1 *before* loading this module for the first
+time.
+
=cut
our $NPRI = 4;
-our $BASE = init;
+our $BASE;
+our $ENABLE_EPOLL;
+
+{
+ local $ENV{EVENT_NOEPOLL};
+ $ENV{EVENT_NOEPOLL} = 1 unless $ENABLE_EPOLL;
+ $BASE = init;
+}
+
priority_init $NPRI;
push @AnyEvent::REGISTRY, [EV => "EV::AnyEvent"];