From 6222afa70d089f265f42f90e1e73ae20744a0bc9 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 3 Jan 2006 17:03:46 +0000 Subject: [PATCH] Move mmap consistency FAQ into assignment description. --- doc/vm.texi | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/doc/vm.texi b/doc/vm.texi index 0f6fa4f..2c96747 100644 --- a/doc/vm.texi +++ b/doc/vm.texi @@ -556,6 +556,12 @@ implicitly or explicitly, all pages written to by the process are written back to the file, and pages not written must not be. The pages are then removed from the process's list of virtual pages. +If two or more processes map the same file, there is no requirement that +they see consistent data. Unix handles this by making the two mappings +share the same physical page, but the @code{mmap} system call also has +an argument allowing the client to specify whether the page is shared or +private (i.e.@: copy-on-write). + @node Project 3 FAQ @section FAQ @@ -785,14 +791,6 @@ munmap (map); The @command{mcp} program in @file{src/examples} shows how to copy a file using memory-mapped I/O. -@item What if two processes map the same file into memory? - -There is no requirement in Pintos that the two processes see -consistent data. Unix handles this by making the two mappings share the -same physical page, but the @code{mmap} system call also has an -argument allowing the client to specify whether the page is shared or -private (i.e.@: copy-on-write). - @item What happens if a user removes a @code{mmap}'d file? The mapping should remain valid, following the Unix convention. -- 2.30.2