3 ms·
In instances where you may have many processes reading the same files in some sort of access pattern and you know they need to be in disk cache you can use fadv
by ghotli 15y ago
In instances where you may have many processes reading the same files in some sort of access pattern and you know they need to be in disk cache you can use fadvise[1]. It'll let you tell the kernel that I am going to need that file, why don't you go ahead and get it in the disk cache.
For many applications this is not the right way to go, but for completely predictable access patterns on a machine that is devoted to it, it can save the day.
[1] http://linux.die.net/man/2/fadvise http://linux.die.net/man/2/fadvise
- rbranson 15y agoThere is an madvise() syscall that roughly translates into an fadvise() for memory-mapped regions as well.