Questions tagged [aio]

Asynchronous Input/Output, in computer science, is a form of input/output processing that permits other processing to continue before the transmission has finished.

177 questions
0
votes
0 answers

What kinds of i/o error returns when remove disk abnormally?

What kinds of i/o error returns when remove disk abnormally(physically)? I use linux aio functions to i/o files. If I remove disk abnormally after "io_submit(control blocks with i/o infos)", suspend aio(io_getevents) will return events with EBADF or…
rnsjtngus
  • 225
  • 1
  • 8
0
votes
0 answers

static array of struct vs malloc array of struct with libaio

I repost the question with full source code. I'm struggling on Libaio for asynchronous file I/O. I think it's too strange to understand. If I malloc array of struct & call io_prep_pwrite like following : #define _GNU_SOURCE #include…
H.U.N.
  • 95
  • 9
0
votes
1 answer

Conventional way of accepting connections in a proactive web-server (using asynchronous IO)

I'm currently exploring the aio on linux to use it for implementing a web-server. As I have already discovered, there are not too many resources that cover in detail the usage of aio. The question is -- what is the conventional way of accepting the…
Maksim Skurydzin
  • 10,301
  • 8
  • 40
  • 53
0
votes
0 answers

C POSIX - aio_read, aio_write checking file contents and replacing non alpha-numeric characters

[EDIT - 06.01.2020] I am trying to write a program which will do asynchronous I/O. The program takes 2 parameters: the filename f and the number of blocks n. The file size must be divided into n blocks of equal size and the reminder part of the file…
daniel_p
  • 31
  • 6
0
votes
0 answers

Kafka consumer proceed hanging awaiting messages when connection is lost

I am using aiokafka==0.5.2 as python lib for kafka I have just the code form the example: async def consume(): consumer = AIOKafkaConsumer( 'my_topic', 'my_other_topic', loop=loop, bootstrap_servers='localhost:9092', …
Rudziankoŭ
  • 10,681
  • 20
  • 92
  • 192
0
votes
1 answer

Why _SC_AIO_MAX is well-defined while sysconf(_SC_AIO_MAX) return -1?

Here is a simple demo: #include #include #include #include #include #include #include #include #include int main() { #ifdef _SC_AIO_MAX …
Chen Li
  • 4,824
  • 3
  • 28
  • 55
0
votes
3 answers

Large byte array transfer to client

Let me present my situation. I have a lot of data in bytes stored in files on server. I am writing and reading this files using AIO that is coming in JDK7. Thus, I am using ByteBuffer(s) for read and write operations. The question is once I have…
Ivan Senic
  • 539
  • 8
  • 13
0
votes
2 answers

How to write data into an offset which is not 512*n bytes using linux native AIO?

I'm writing some app like Bittorrent client to download file from net and write it to local file. I will get partial data and write to the file. For example, I will download a 1GB file, I will get offset 100, data: 312 bytes, offset 1000000, data:…
garen96
  • 175
  • 1
  • 9
0
votes
0 answers

How to mock aiomysql pool to return a mocked connection object?

I'm trying to write unit test cases for one of my module which uses the aiomysql pool to interface with the MariaDB. I'm trying to mock the database calls for the unit test. I'm using asynctest python module to mock. I've tried to mock the connect…
0
votes
1 answer

aio_write failing on release builds

I'm using aio_write it is working in a debug build but not in release. I've checked the constructor that everything is initialized and I'm not getting any warnings about uninitialized variables. The class collects data that is to be written to…
IronMensan
  • 6,761
  • 1
  • 26
  • 35
0
votes
1 answer

Kernel Oops when calling aio_complete by workqueue

Short Edition of the question: Process submit IO through io_submit(file open with O_DIRECT). When kiocb->ki_complete(aio_complete_rw) is called in fs address_space_operations .direct_IO, everything works well. But when…
zz bb
  • 13
  • 4
0
votes
1 answer

Is there a way to read a text file byte by byte asynchronously with POSIX threads?

I am trying to read and copy its contents to another file asynchronously with POSIX threads in C. Assuming a file contains "aabbcc" and i have 4 threads, how can i copy "aabbcc" to another file with threads asynchronously in C. This part has been…
0
votes
1 answer

Does a file descriptor used with POSIX AIO need to be opened with `O_NONBLOCK` in `open()`?

When using POSIX AIO with a file descriptor, did the file descriptor need to be opened with O_NONBLOCK in open()? In APUE, I don't find it explicitly say yes or no, but I don't find such a file descriptor is opened with O_NONBLOCK in open() in one…
Tim
  • 1
  • 141
  • 372
  • 590
0
votes
1 answer

Different results when running inside a docker container

I am trying to run some code based on this libaio sample: https://oxnz.github.io/2016/10/13/linux-aio/#example-1 I added the O_DIRECT flag according to libaio's documentation. It seems to work inside my ubuntu 16.04 desktop machine (hello is written…
barisdad
  • 515
  • 7
  • 19
0
votes
1 answer

What library or API should I use to implement a linux kernel module doing asynchronous IO?

First I will tell environment of my PC, background of my question, my problem, than I will explain my exact question. Environment: OS: Ubuntu 16.04 Kernel: 4.17.1 CPU: i7-6700k Memory: 8GB DRAM Storage: SSD 120GB Background: I'm trying to optimizing…
양석우
  • 3
  • 1