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
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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With