--- libev/ev.pod 2019/06/22 16:25:53 1.447 +++ libev/ev.pod 2019/06/23 02:02:24 1.448 @@ -576,33 +576,37 @@ =item C (value 64, Linux) -Use the linux-specific linux aio (I C<< aio(7) >>) event interface -available in post-4.18 kernels. +Use the linux-specific linux aio (I C<< aio(7) >> but C<< +io_submit(2) >>) event interface available in post-4.18 kernels. If this backend works for you (as of this writing, it was very -experimental and only supports a subset of file types), it is the best -event interface available on linux and might be well worth it enabling it -- if it isn't available in your kernel this will be detected and another -backend will be chosen. - -This backend can batch oneshot requests and uses a user-space ring buffer -to receive events. It also doesn't suffer from most of the design problems -of epoll (such as not being able to remove event sources from the epoll -set), and generally sounds too good to be true. Because, this being the -linux kernel, of course it suffers from a whole new set of limitations. +experimental), it is the best event interface available on linux and might +be well worth enabling it - if it isn't available in your kernel this will +be detected and this backend will be skipped. + +This backend can batch oneshot requests and supports a user-space ring +buffer to receive events. It also doesn't suffer from most of the design +problems of epoll (such as not being able to remove event sources from +the epoll set), and generally sounds too good to be true. Because, this +being the linux kernel, of course it suffers from a whole new set of +limitations. For one, it is not easily embeddable (but probably could be done using -an event fd at some extra overhead). It also is subject to various -arbitrary limits that can be configured in F -and F), which could lead to it being skipped during -initialisation. - -Most problematic in practise, however, is that, like kqueue, it requires -special support from drivers, and, not surprisingly, not all drivers -implement it. For example, in linux 4.19, tcp sockets, pipes, event fds, -files, F and a few others are supported, but ttys are not, so -this is not (yet?) a generic event polling interface but is probably still -be very useful in a web server or similar program. +an event fd at some extra overhead). It also is subject to a system wide +limit that can be configured in F - each loop +currently requires C<61> of this number. If no aio requests are left, this +backend will be skipped during initialisation. + +Most problematic in practise, however, is that not all file descriptors +work with it. For example, in linux 5.1, tcp sockets, pipes, event fds, +files, F and a few others are supported, but ttys do not work +(probably because of a bug), so this is not (yet?) a generic event polling +interface. + +To work around this latter problem, the current version of libev uses +epoll as a fallback for file deescriptor types that do not work. Epoll +is used in, kind of, slow mode that hopefully avoids most of its design +problems. This backend maps C and C in the same way as C.