Asynchronous Input/Output, in computer science, is a form of input/output processing that permits other processing to continue before the transmission has finished.
Questions tagged [aio]
177 questions
1
vote
1 answer
use aio_write() but still see data going through cache?
I'm playing with this code on Linux 2.6.16.46:
io.aio_fildes = open(name, O_CREAT | O_TRUNC | O_WRONLY | O_SYNC, 00300);
io.aio_buf = buffer;
io.aio_nbytes = size;
io.aio_sigevent = sigev;
io.aio_lio_opcode = LIO_WRITE;
aio_write( &io );
This…

n-alexander
- 14,663
- 12
- 42
- 43
1
vote
1 answer
pthread_sigmask not working properly with aio callback threads
My application is sometimes terminating from SIGIO or SIGUSR1 signals even though I have blocked these signals.
My main thread starts off with blocking SIGIO and SIGUSR1, then makes 2 AIO read operations. These operations use threads to get…

bottaio
- 4,963
- 3
- 19
- 43
1
vote
1 answer
AIO in C on Unix - aio_fsync usage
I can't understand what this function aio_fsync does. I've read man pages and even googled but can't find an understandable definition. Can you explain it in a simple way, preferably with an example?

Greyshack
- 1,901
- 7
- 29
- 48
1
vote
1 answer
Sending FUA requests using libaio on Linux
I'm trying to access a block device (say /dev/sdb) using libaio.
I works correctly, but I was wondering how to perform FUA (Force Unit Access) using the API of libaio.
I must say the documentation I found on the subject is quite poor, hope one of…

OznOg
- 4,440
- 2
- 26
- 35
1
vote
1 answer
Can the vector read and write functions of libaio be used on a direct device?
libaio documentation on use with direct devices says read and write offsets must be sector aligned e.g. multiples of 512 bytes for a typical SSD/HDD. Some of the info available on the web also says that the user space buffers used as source and…

Alex
- 421
- 5
- 8
1
vote
1 answer
Errors of aio_write
I'm rewriting a write to aio_write so I can deal with timeouts (and I don't want to bother with select). One thing that I don't understand from the man pages is how can the aio_write fail.
For write I'm mostly interested in partial writes and EINTR.…

Šimon Tóth
- 35,456
- 20
- 106
- 151
1
vote
1 answer
io_submit() blocks until a previous operation will be completed
I'm using the Linux kernel AIO through libaio, and I have to submit the next reading operation before the previous one was completed. The problem is that io_submit() blocks for some time and, as I can deduce from the interval, it waits the previous…

vdudouyt
- 843
- 7
- 14
1
vote
2 answers
Fill file ASCII values
I want to create a file filled with 0 or other letters. Here's my function
int fill(const int d, struct aiocb *aiorp, void *buf, const int count){
int rv = 0;
memset( (void *)aiorp, 0, sizeof( struct aiocb ) ); // <-here second…

David
- 3,055
- 4
- 30
- 73
1
vote
1 answer
Linux system call aio_write() fails with error code 22 (EINVAL)
I have a testing utility that uses linux aio_write and aio_read.
This testing utility wraps my static library and test it. This library is multi-threaded black box.
Up until now, it worked fine. But now we made a big change into the this black-box…

yanger
- 227
- 1
- 3
- 14
1
vote
1 answer
Kernel AIO (libaio) write request fails when writing from memory reserved at boot time
I am pretty new to linux aio (libaio) and am hoping someone here with more experience can help me out.
I have a system that performs high-speed DMA from a PCI device to the system RAM. I then want to write the data to disk using libaio directly…

bripappas
- 86
- 4
1
vote
0 answers
aio_read causing bad address on OSX
I have async io code in OSX that basically does the following:
aiocb request;
memset(&request, 0 sizeof(request));
char buffer[64 * 1024];
int filedes = open(path, O_RDONLY);
request->aio_offset = offset;
request->aio_fildes =…

RunHolt
- 1,892
- 2
- 19
- 26
1
vote
1 answer
aio_read from STDIN_FILENO returns EAGAIN in OS X
When I compile this code in OS X:
#include
#include
#include
#include
#include
#include
using namespace std;
int main(int, char*[])
{
const int iBufSize = 1<<20;
…

Thendore
- 11
- 1
1
vote
1 answer
HornetQ not using AIO on ubuntu
I have installed libaio on ubuntu, and running HornetQ embedded, with programmatic config, I am doing this to use AIO on journal, but I see on startup, it's not getting AIO, always using NIO. Any way to determine why it would be failing?
…

Alper Akture
- 2,445
- 1
- 30
- 44
1
vote
1 answer
Linux kernel asynchronous AIO: do I need to copy over the struct iovec for later processing?
I have added support for AIO in my driver (the .aio_read , .aio_write calls in kernelland, libaio in userland) and looking at various sources I cannot find if in my aio_read, .aio_write calls I can just store a pointer to the iovector argument (in…

Bram
- 21
- 3
1
vote
0 answers
Linux aio_write is very slow in btrfs, almost reduced by 60% rate. Do someone know the reason?
Here is my code:
// init
int total;
struct aiocb aio;
bzero((char *)&aio, sizeof(struct aiocb));
aio.aio_buf = malloc(BUF_MAX1+1);
aio.aio_nbytes = BUF_MAX1;
aio.aio_fildes = write_file;
aio.aio_offset = 0;
int ret;
while (total <= 900008200){ //…

Yifan Wang
- 504
- 6
- 13