From: Ben Pfaff Date: Tue, 3 Jan 2006 17:03:46 +0000 (+0000) Subject: Move mmap consistency FAQ into assignment description. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf53f54a26af9c265606b2026ac5b2daecc5e37a;p=pintos-anon Move mmap consistency FAQ into assignment description. --- 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.