|
|
Subscribe / Log in / New account

Non-blocking buffered file read operations

Non-blocking buffered file read operations

Posted Sep 26, 2014 12:23 UTC (Fri) by JGR (subscriber, #93631)
In reply to: Non-blocking buffered file read operations by eNovance
Parent article: Non-blocking buffered file read operations

> I don't understand how this API should be used. If I get EAGAIN, how can I asynchronously get more bytes?

> Is there an asynchronous "readahead" syscall? Or should I fallback to the blocking read()?

The idea is that if you get an EAGAIN you can then do a blocking read using your thread pool.
However if the data is already in the page cache, you get it instantly without having incurred the overhead of context switching to/from a thread pool, and without the risk of blocking your "main" thread potentially indefinitely.


to post comments

Non-blocking buffered file read operations

Posted Sep 26, 2014 23:49 UTC (Fri) by giraffedata (guest, #1954) [Link]

And there must be some applications where if you can't get the data quickly and cheaply, you'll just do without it.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds