Asynchronous File I/O on Linux

Richard Pieri richard.pieri-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Sun May 16 11:56:16 EDT 2010


On May 16, 2010, at 10:06 AM, Mark Woodward wrote:
> 
> Well, it is "async" in the view that I want to issue multiple read 
> requests simultaneously from the same execution context (thread or 
> process). What I want to test is *if* I can issue multiple read requests 

That's definitely not asynchronous I/O.  Asynchronous means that the calling process doesn't wait for the write call to finish.  That is, the process runs asynchronously to the write.  Reads are always synchronous.

What you described is either concurrent or parallel (I'm not precisely sure which term is most appropriate) reads.  Can you do it?  Sure, just as I described: create as many file handles to the file that you need with open().  Each file handle has its own unique read/write pointer to the file.

--Rich P.







More information about the Discuss mailing list