[CM] file ops

e deleflie edeleflie@gmail.com
Mon, 28 May 2007 12:37:06 +1000


On 5/26/07, Bill Schottstaedt <bil@ccrma.stanford.edu> wrote:
> Since several people seem to be worrying about disk accesses --
> I think that modern OS's (linux in particular)
> automatically cache files in RAM -- what appear to be disk ops are
> actually references to memory.  In the bad old days you had to use
> mmap or something -- I forget how it used to work.
> This info itself may be out-of-date -- I am not an OS wizard!

from my limited experience processing large video files in real-time
(in Linux), the files are definately cached in RAM... but they have to
be read first.

That means that the first time they are read, the process is
disk-bound, and the second, third etc. time, they are in RAM.

So if doing tests on these things, only the first result is correct.
After that, the RAM cache has to be emptied. I used to find that the
best testing strategy was to use 2 files (large engouh to fill the RAN
cache) and toggle between the 2.

I used to use a software called jMAX (by IRCAM). From memory, I
believe they had disk access system that automatically managed how
disks were read, specifically for real-time applications to avoid
interrupts and drop outs. The project is more or less dead now, but
unless I'm mistaken, that code should be here:

http://jmax.cvs.sourceforge.net/jmax/jmax/packages/unixdtd/c/src/

(no idea if that's useful)

Etienne