Discussion
Memory-mapped file input and output means that
Answer: D
Correct answer: a file is mapped into the address space and accessed as if it were memory
Memory mapping associates a region of a process’s address space with a file on disk. Reading or writing that memory reads or writes the file, with the paging system doing the transfer as ordinary page faults. The advantage is that the usual read and write system calls disappear, and with them a copy: normally data moves from disk to a kernel buffer and then to the process’s buffer, whereas a mapped file is paged straight into the process’s own frames. For a file accessed repeatedly or randomly, that is substantially faster. It also provides shared memory between processes almost for free: two processes mapping the same file share the physical frames, and a write by one is visible to the other. Writes are not necessarily immediate - the operating system may defer them until the page is evicted or the file is closed - so an explicit synchronisation call exists where durability matters. Shared libraries are loaded this way, which is how one copy serves every process.
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development