libeio and plattform specific aio

Marc Lehmann schmorp at
Wed Jun 4 09:52:54 CEST 2008

On Tue, Jun 03, 2008 at 11:51:47PM +0200, Aleksandar Lazic <al-libev at> wrote:
> what do you think, will libeio be able to use the 'best' aio for the
> plattform, or are there all only part of the solution?

It would be, but you need to be careful - linux doesn't have working
AIO for normal files - the libc on linux emulates it using threads, and
libeio's threads are much lower on resource usage and are also faster.

solaris has kernel-aio, but it also uses threads, so it's not clearly better.
in fact, you lose scheduling control when using them.

something similar is true for kqueue - you might actually get better
performance and more control via threads.

windows would be kind of closest :)

so while libeio certainly could transparently use native aio, this currently
isn't on my priority list, as on most platforms it will just use threads
anyways or will not work very well.

if somebody sent a patch for some platform and maintained it, that would
of course be very welcome (especially if some benchmark showed how this
affects resource usage and efficiency), but it is likely too early to use
native aio on most operating systems.

kqueue is probably closest to something like that, followed by windows.
note, however, that rarely-used features in kqueue have been broken in
100% of the cases in the past, so don't get your hopes up.

(of course, threading is usually broken on bsd's as well, so it might not
be much worse).

                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_    
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      pcg at
      -=====/_/_//_/\_,_/ /_/\_\

More information about the libev mailing list