paul@ppgbms (Paul Evan Matz) (12/22/89)
I was wondering if someone out there could recommend any references on mmap(). After experimenting with it a bit, I am uncertain as to the used of the first arguement, addr: caddr_t mmap(addr, len, prot, flags, fd, off) caddr_t addr; int len, prot, flags, fd; off_t off; The man page suggests it has much significance, in conjunction with flags. What we'd like to be able to do is somehow eliminate the disk I/O on the open file. (I don't know whether the addr parameter has the least bit to do with this). Is there a way to cause the entire file, associated with fd, to be cached in memory instead of being written to the disk? The scenerio is as follows: One process is writing large amounts of data (raster data) to an output file, while another process is reading that data, manipulating it, and writing it to an output device. We'd like to eliminate the time it takes to write the data to, and read the data from, the disk. Unfortunately, we can't modify the writer to use shared memory, since it is not our code. mmap() seems like it might be what we are looking for. But, if writes to the "memory object" are also written to the disk, as it appears in our testing, then it doesn't buy us too much, except pseudo random direct memory access by the reader. Any tips or comments will be much appreciated. Thanks. (Merry New Year) _____________________________________________________________ |Regards, One Campus Drive | |Paul Matz PPG Biomedical Systems | |914-741-4685 Pleasantville, NY. 10570| ------------------------------------------------------------- path ppgbms!moe!paul@philabs.philips.com