Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Posix AIO Bad/Broken? [closed]

Tags:

c

posix

sockets

aio

I'm working on a TFTP implementation that is transitioning away from a convoluted multi-threaded implementation to a single-thread/single-process implementation which uses a state machine to track the state of the sessions connected. TFTP is simple enough, and the number of concurrent sessions are small enough that the there really is no impact to the software other than massive code-size & complexity savings.

Of course, I can't just block on a single session when others are connected. To remedy this, my first thought was POSIX AIO, though after some research I read that it's

  • Poorly Documented, and not complete
  • Only works on Disk I/O and does not support sockets, or works on sockets but only for read/writes - Not for listening.

An example is contained in this link (http://davmac.org/davpage/linux/async-io.html), though I found others as well. Some additional perspective was given in a prior stackoverflow post (What is the status of POSIX asynchronous I/O (AIO)?) from '08.

For a C developer, is AIO still as broken as people claim? Do people really not use AIO, and stick primarily to poll/select or finite size thread pools?

like image 371
Bob Avatar asked Nov 14 '22 09:11

Bob


1 Answers

Poorly documented is certainly the case.

Most people do stick with poll() / select(), simply because these are well-understood, well-tested, well-documented and well-supported. If I were you I would use select() unless you have a compelling reason not to.

like image 100
caf Avatar answered Dec 19 '22 10:12

caf