OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 6:15 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: How much is POSIX AIO used today?
PostPosted: Sun Dec 18, 2022 6:44 am 
Offline
Member
Member

Joined: Mon Jul 05, 2010 4:15 pm
Posts: 595
POSIX AIO has been around now for quite a while. It has been in the Linux kernel for something like 15 years. I've been looking into a few contemporary libraries (like HTTP servers libraries) and still see that they are not using POSIX AIO but the more classical methods (select/epoll). I haven't looked into all libraries of course and that's why I'm asking here.

What is your impression how much POSIX AIO is used where it would make sense?


Top
 Profile  
 
 Post subject: Re: How much is POSIX AIO used today?
PostPosted: Sun Dec 18, 2022 3:44 pm 
Offline
Member
Member
User avatar

Joined: Sun Apr 30, 2017 12:16 pm
Posts: 68
Location: Poland
I think the main problem with POSIX AIO is that it signals completion via signals, which are more annoying to deal with.

On Linux you can get the benefits of AIO (async disk I/O) with io_uring, which operates based on submission and completion queues, with no explicit notification mechanism (apart from having a call to suspend if there are no events in the completion queue, a la poll). In other cases you can just use sockets or pipes internally and spawn helper threads for blocking I/O.

_________________
Working on managarm.


Top
 Profile  
 
 Post subject: Re: How much is POSIX AIO used today?
PostPosted: Sun Dec 18, 2022 11:02 pm 
Offline
Member
Member

Joined: Wed Aug 30, 2017 8:24 am
Posts: 1593
You can also use aio_error() to poll the error status of your aiocbs, and aio_suspend() to suspend the thread until one operation is available. It almost looks like you could implement POSIX AIO with io_uring, and wouldn't that be a wonderful thing? I think that was the point of POSIX, to abstract OS specific APIs to portable ones.

To the original question, Debian Code Search finds 1384 results for aio_return(). This does include compilers and libcs, but there are also users among such luminaries as chromium, directfb, elfutils, virtualbox, and zfs. So yeah, looks like it is used quite a bit.

_________________
Carpe diem!


Top
 Profile  
 
 Post subject: Re: How much is POSIX AIO used today?
PostPosted: Mon Dec 19, 2022 8:34 am 
Offline
Member
Member

Joined: Tue Feb 18, 2020 3:29 pm
Posts: 1071
nullplan wrote:
So yeah, looks like it is used quite a bit.

A lot of those programs probably use AIO as a fallback in case something better (like io_uring) don't exist. Hence I'm sure the number of programs that are actually dependent on AIO is relatively small.

_________________
"How did you do this?"
"It's very simple — you read the protocol and write the code." - Bill Joy
Projects: NexNix | libnex | nnpkg


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 27 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group