Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Asynchronous File I/O on Linux



On May 16, 2010, at 2:30 PM, Mark Woodward wrote:
> 
> While I can see your point, it would be impossible to do multiple simultaneous requests without some sort of asynchronous I/O capability.  The "random access" aspect of it comes out of using multiple file handles to a single file.

Not true.  read() and friends usually block until the read completes or an error occurs.  If you open() a file with O_NONBLOCK then the read() call returns an error if there is nothing ready to be read.  This gets you nowhere near parallel reads, but it does get you a polling loop that chews up CPU while effectively blocking your program anyway.


> Besides, you probably mean O_RDWR or O_RDONLY, O_WRONLY won't work in your example.

Probably. :)

--Rich P.








BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org