title: Understanding Memory Mapped Files
body: <p>I have started reading about memory mapped IO and I'm having some difficulties grasping the concepts</p>
  
  <p>This is what I have understood so far:</p>
  
  <blockquote>
    <p>Each process has a virtual address space. Memory mapped files are allocated a
           specific address range in the virtual address space, that maps to the same address on 
           the physical memory. This way, all the writes that are done by the disk controller on<br>
           the memory(through DMA) will be reflected to the process without any additional 
           copying. (In a non memory mapped file case, CPU will have to copy the contents over 
           to the buffer of the process). </p>
  </blockquote>
  
  <p>My Doubts:</p>
  
  <ul>
  <li><p>Is my understanding correct?</p></li>
  <li><p>What will happen if there are multiple processes trying to mmap a
     file and there is no continuous block of memory available for direct mapping?</p></li>
  </ul>