… | |
… | |
116 | print <<EOF; |
116 | print <<EOF; |
117 | |
117 | |
118 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
118 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
119 | |
119 | |
120 | |
120 | |
121 | EV by default uses select, which makes it hard to write efficient servers, |
121 | Select and poll make it hard to write efficient servers, especially if the |
122 | especially if the number of active connections is much lower than the open |
122 | number of active connections is much lower than the watched ones. GNU/Linux |
123 | ones. GNU/Linux systems have a more scalable method called "epoll", which |
123 | systems have a more scalable method called "epoll", which EV can use. For |
124 | EV can use. For this to work, both your kernel and glibc have to support |
124 | this to work, both your kernel and glibc have to support epoll, but if you |
125 | epoll, but if you can compile it, the detection will be done at runtime, |
125 | can compile it, the detection will be done at runtime, and EV will safely |
126 | and EV will safely fall back to using select when epoll isn't available. |
126 | fall back to using select when epoll isn't available. If unsure, accept |
127 | If unsure, accept the default. |
127 | the default. |
128 | |
128 | |
129 | EOF |
129 | EOF |
130 | |
130 | |
131 | $DEFINE .= " -DEV_USE_EPOLL=" . (0 + (prompt ("Enable epoll backend (y/n)?", (-e "/usr/include/sys/epoll.h") ? "y" : "n") =~ /[yY]/)); |
131 | $DEFINE .= " -DEV_USE_EPOLL=" . (0 + (prompt ("Enable epoll backend (y/n)?", (-e "/usr/include/sys/epoll.h") ? "y" : "n") =~ /[yY]/)); |
132 | |
132 | |
… | |
… | |
138 | Similarly to the epoll backend above, EV can take advantage of kqueue on |
138 | Similarly to the epoll backend above, EV can take advantage of kqueue on |
139 | many BSD systems. Support for kqueue will be detected at runtime, with a |
139 | many BSD systems. Support for kqueue will be detected at runtime, with a |
140 | safe fallback to other methods when it cannot be used. |
140 | safe fallback to other methods when it cannot be used. |
141 | |
141 | |
142 | Note that kqueue is broken on most operating systems, so it defaults to |
142 | Note that kqueue is broken on most operating systems, so it defaults to |
143 | 'n' on most platforms that claim to support it. Here is what we know: |
143 | 'n' on everything but netbsd. Here is what we know: |
144 | |
144 | |
145 | OS X: completely, utterly broken on at least <= 10.5. |
145 | NetBSD: working in at least 3.1. Yeah! :) |
146 | FreeBSD: broken on at least <= 6.2-STABLE, |
146 | FreeBSD: broken on at least 6.2-STABLE, |
147 | sockets and pipes *might* work, ptys definitely don't. |
147 | sockets and pipes *might* work, ptys definitely don't. |
148 | NetBSD: reports indicate that it likely WORKS. Yeah! :) |
|
|
149 | OpenBSD: reports indicate that it likely doesn't work |
148 | OpenBSD: reports indicate that it likely doesn't work |
150 | (similar problems as on FreeBSD). |
149 | (similar problems as on FreeBSD). |
|
|
150 | OS X: completely, utterly broken on at least <= 10.5. |
151 | |
151 | |
152 | EOF |
152 | EOF |
153 | |
153 | |
154 | my $can_kqueue = $^O =~ /netbsd/i && -e "/usr/include/sys/event.h"; |
154 | my $can_kqueue = $^O =~ /netbsd/i && -e "/usr/include/sys/event.h"; |
155 | |
155 | |