mmap (was: fast constructor for arrays from byte data)

Chris Barker writes:
This might be more than you need to know, but there's a copy of the article: "Why aren't you using mmap() yet?" by Kevin Sheehan at: http://thrush.eos.ubc.ca/users/phil/mmap/mmap.pdf (note reversed page order) and a Solaris/SGI email debate in mhonarc format: http://thrush.eos.ubc.ca/users/phil/mmap/threads.html bottom line: you really need a vm implementation that supports madvise() to get the maximum benefit from mmap. (Linux 2.4 might have madvise, I haven't tried it out yet -- 2.2 didn't). The way I used to use mmap was through a numpy array class that was initiated from a pointer to a mmap'd file. This made reading/writing to the file as simple as indexing into the numpy array. I haven't been back to reimplement that class on linux since I left solaris, though. You can also get some of the benefits of mmap via netcdf, which will use mmap if it exists. Regards, Phil

On Wed, Aug 08, 2001 at 01:56:56PM -0700, Phil Austin wrote: [snip pointers to info]
FWIW, there appears to be a madvise(2) system call in Linux 2.4.7 (in mm/filemap.c for those of you with kernel source trees lying around), but I can't find it in the headers anywhere. Sigh. I don't know if madvise is supposed to be internal or not, though. -- Robert Kern kern@caltech.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter

On Wed, Aug 08, 2001 at 01:56:56PM -0700, Phil Austin wrote: [snip pointers to info]
FWIW, there appears to be a madvise(2) system call in Linux 2.4.7 (in mm/filemap.c for those of you with kernel source trees lying around), but I can't find it in the headers anywhere. Sigh. I don't know if madvise is supposed to be internal or not, though. -- Robert Kern kern@caltech.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter
participants (2)
-
Phil Austin
-
Robert Kern