Figure 6.7:
Left: (a) Segmented process before mapping files into its address space (b) Process after mapping
existing file abc into one segment creating new segment for xyz. Right: Memory mapped files and paging
|
- Avoids translating from on-disk format to in-memory format (and vice versa)
- Supports complex structures
- No read/write systems calls
- File simply (paged or swapped) to file system
- Unmap when finished
- Problems
- Determining actual file size after modification; Round to nearest whole page (even if only 1 byte file)
- Care must be taken if file is shared; E.g. one process memorymapped and one process read/write syscalls
- Large files may not fit in the virtual address space
2004-05-25