AIO for Liux?

89 views
Skip to first unread message

Pedro Teixeira

unread,
Dec 8, 2011, 3:56:18 PM12/8/11
to nodejs
Hey,

Perhaps this sounds like a dumb question, but I've not been able to
find the answer:

libuv uses completion ports in Windows and eio in Unix in general.
Shouldn't it also use aio ( https://www.ibm.com/developerworks/linux/library/l-async/
) specifically for Linux?

I mean, and correct me if I'm wrong, Node "fs" module is now optimized
for Windows and not Linux, right?
Personally I'd like to see that module not using the thread pool...

Thanks,

-Pedro

Ben Noordhuis

unread,
Dec 8, 2011, 4:20:21 PM12/8/11
to nod...@googlegroups.com

Here is why AIO is not an option:

https://github.com/joyent/node/issues/1446#issuecomment-1721004

Besides the limitations that the native AIO API imposes it's also
possible for it to not actually be supported by the kernel or the file
system - in which case it may either report an error or fall back to
synchronous I/O...

On a side note, that article you linked to discusses the aio_*()
functions. They're unrelated to native Linux AIO, it's just wrappers
around a thread pool in user space (like libeio, only less flexible
and more awkward to use).

Pedro Teixeira

unread,
Dec 9, 2011, 9:54:41 AM12/9/11
to nodejs
Ok, Ben, thanks for the info! :)
Do you know if Node core is considering any solution for getting rid
of the usage of the thread pool for asynchronous fs in *NIX (if that's
even possible with any current *NIX?)?

Thanks!

On Dec 8, 9:20 pm, Ben Noordhuis <i...@bnoordhuis.nl> wrote:


> On Thu, Dec 8, 2011 at 21:56, Pedro Teixeira <pedro.teixe...@gmail.com> wrote:
> > Hey,
>
> > Perhaps this sounds like a dumb question, but I've not been able to
> > find the answer:
>
> > libuv uses completion ports in Windows and eio in Unix in general.

> > Shouldn't it also useaio(https://www.ibm.com/developerworks/linux/library/l-async/


> > ) specifically for Linux?
>
> > I mean, and correct me if I'm wrong, Node "fs" module is now optimized
> > for Windows and not Linux, right?
> > Personally I'd like to see that module not using the thread pool...
>
> > Thanks,
>
> > -Pedro
>

> Here is whyAIOis not an option:
>
> https://github.com/joyent/node/issues/1446#issuecomment-1721004
>
> Besides the limitations that the nativeAIOAPI imposes it's also


> possible for it to not actually be supported by the kernel or the file
> system - in which case it may either report an error or fall back to
> synchronous I/O...
>
> On a side note, that article you linked to discusses the aio_*()

> functions. They're unrelated to native LinuxAIO, it's just wrappers

Ben Noordhuis

unread,
Dec 9, 2011, 10:22:51 AM12/9/11
to nod...@googlegroups.com
On Fri, Dec 9, 2011 at 15:54, Pedro Teixeira <pedro.t...@gmail.com> wrote:
> Ok, Ben, thanks for the info! :)
> Do you know if Node core is considering any solution for getting rid
> of the usage of the thread pool for asynchronous fs in *NIX (if that's
> even possible with any current *NIX?)?
>
> Thanks!

To my knowledge there is no UNIX platform that we support with a
functional AIO API (with the exception of Solaris - maybe) so the
thread pool is here to stay for the foreseeable future.

Reply all
Reply to author
Forward
0 new messages