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
> 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.
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.
Non-blocking buffered file read operations