… | |
… | |
4423 | =head3 C<kqueue> is buggy |
4423 | =head3 C<kqueue> is buggy |
4424 | |
4424 | |
4425 | The kqueue syscall is broken in all known versions - most versions support |
4425 | The kqueue syscall is broken in all known versions - most versions support |
4426 | only sockets, many support pipes. |
4426 | only sockets, many support pipes. |
4427 | |
4427 | |
|
|
4428 | Libev tries to work around this by not using C<kqueue> by default on |
|
|
4429 | this rotten platform, but of course you can still ask for it when creating |
|
|
4430 | a loop. |
|
|
4431 | |
4428 | =head3 C<poll> is buggy |
4432 | =head3 C<poll> is buggy |
4429 | |
4433 | |
4430 | Instead of fixing C<kqueue>, Apple replaced their (working) C<poll> |
4434 | Instead of fixing C<kqueue>, Apple replaced their (working) C<poll> |
4431 | implementation by something calling C<kqueue> internally around the 10.5.6 |
4435 | implementation by something calling C<kqueue> internally around the 10.5.6 |
4432 | release, so now C<kqueue> I<and> C<poll> are broken. |
4436 | release, so now C<kqueue> I<and> C<poll> are broken. |
4433 | |
4437 | |
4434 | Libev tries to work around this by neither using C<kqueue> nor C<poll> by |
4438 | Libev tries to work around this by not using C<poll> by default on |
4435 | default on this rotten platform, but of course you cna still ask for them |
4439 | this rotten platform, but of course you can still ask for it when creating |
4436 | when creating a loop. |
4440 | a loop. |
4437 | |
4441 | |
4438 | =head3 C<select> is buggy |
4442 | =head3 C<select> is buggy |
4439 | |
4443 | |
4440 | All that's left is C<select>, and of course Apple found a way to fuck this |
4444 | All that's left is C<select>, and of course Apple found a way to fuck this |
4441 | one up as well: On OS/X, C<select> actively limits the number of file |
4445 | one up as well: On OS/X, C<select> actively limits the number of file |
4442 | descriptors you can pass in to 1024 - your program suddenyl crashes when |
4446 | descriptors you can pass in to 1024 - your program suddenly crashes when |
4443 | you use more. |
4447 | you use more. |
4444 | |
4448 | |
4445 | There is an undocumented "workaround" for this - defining |
4449 | There is an undocumented "workaround" for this - defining |
4446 | C<_DARWIN_UNLIMITED_SELECT>, which libev tries to use, so select I<should> |
4450 | C<_DARWIN_UNLIMITED_SELECT>, which libev tries to use, so select I<should> |
4447 | work on OS/X. |
4451 | work on OS/X. |
… | |
… | |
4464 | this mechanism is very buggy. If you run into high CPU usage, your program |
4468 | this mechanism is very buggy. If you run into high CPU usage, your program |
4465 | freezes or you get a large number of spurious wakeups, make sure you have |
4469 | freezes or you get a large number of spurious wakeups, make sure you have |
4466 | all the relevant and latest kernel patches applied. No, I don't know which |
4470 | all the relevant and latest kernel patches applied. No, I don't know which |
4467 | ones, but there are multiple ones. |
4471 | ones, but there are multiple ones. |
4468 | |
4472 | |
4469 | If you can't get it to work, you can try running the program with |
4473 | If you can't get it to work, you can try running the program by setting |
4470 | C<LIBEV_FLAGS=3> to only allow C<poll> and C<select> backends. |
4474 | the environment variable C<LIBEV_FLAGS=3> to only allow C<poll> and |
|
|
4475 | C<select> backends. |
4471 | |
4476 | |
4472 | =head2 AIX POLL BUG |
4477 | =head2 AIX POLL BUG |
4473 | |
4478 | |
4474 | AIX unfortunately has a broken C<poll.h> header. Libev works around |
4479 | AIX unfortunately has a broken C<poll.h> header. Libev works around |
4475 | this by trying to avoid the poll backend altogether (i.e. it's not even |
4480 | this by trying to avoid the poll backend altogether (i.e. it's not even |