> > I don't think mmap() provides exactly the right behaviour.  
> It lets you
> > specify that modifications made by the current process 
> aren't committed
> > to the file, but what we want is to snapshot the file so 
> that subsequent
> > modifications by *other* processes aren't seen by the local process.
> 
> The Linux manpage isn't very explicit, so I've tried it. When making a
> private mapping (MAP_PRIVATE), it makes a snapshot which is private to
> the process, and isn't affected by other processes. It's 
> exactly what's needed. (see attachment)

It only makes a snapshot of those pages of the file which have been
modified by the current process, because that's when the copy-on-write
happens (a page is 4k on Linux/x86).  In unmodified pages of the file
the mapping is still exposed to modifications by other processes, even
if the current process has already read data from that page - try it!  

Cheers,
        Simon
_______________________________________________
Glasgow-haskell-bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to