Concept Flow - Memory-mapped files
Process requests file data
OS maps file into memory
Process accesses memory address
If page in RAM: data returned immediately
No
Page fault triggers disk read
Data loaded into RAM page
Process continues with data
Changes in memory can be synced back to file
The process asks for file data, OS maps the file into memory, process accesses memory addresses. If data is not in RAM, a page fault loads it from disk. Changes can be saved back to the file.