[eio] readahead

Marc Lehmann schmorp at schmorp.de
Mon Sep 1 18:37:42 CEST 2008

On Mon, Sep 01, 2008 at 05:29:25PM +0200, ryah dahl <ry at tinyclouds.org> wrote:
> I'm trying to understand your emulation for readahead() in libeio. It
> doesn't seem that the eio_buf that is being read into is ever referred
> to again.


> Is the idea that calling pread() will cache the file anyway?

The idea is to emulate the linux readahead(2) syscall, which does the same
thing, it reads the data but doesn't use it/transfer it to the app.

> What about using fadvise?

Indeed, what about it? fadvise isn't blocking anywhere I know of (in fact,
fadvise most often simply does nothing), so it is outside the scope of

(this might change - I was under the impression that close, futime and
fstat were non-blocking, too, but linux proved me wrong :)

                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_              http://www.deliantra.net
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      pcg at goof.com
      -=====/_/_//_/\_,_/ /_/\_\

More information about the libev mailing list