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 (http://stackoverflow.com/questions/87892/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?