Types of Memory Mapped Files
Basically, there are two types of memory mapped files:
- Persisted: Persisted files are connected with a source file on a disk. After completing the final process, the data is saved to the source file on disc. Working with very big source files is appropriate with these type of memory-mapped files.
- Non-persisted: Non-persisted files are not connected to any disk-based files. The data is lost when the last process with the file completes its required task. The shared memory that these files enable for inter-process communications or IPC.
Memory Mapped Files in OS
We can use standard system calls like read(), seek(), open(), and so on to perform a sequential read of a file present on the disk. Thus, to access a file from the disk we need system calls and disk access. Memory mapping is a technique that allows a part of the virtual address space to be associated with a file logically. This technique of memory mapping leads to a significant increase in performance.
Contact Us