I have not tried your program yet, but looking at it I'm not sure it fits
completely into memory. How much RAM does your machine have, and how big
a file are you using?
> I _think_ the problem is update (or whatever update calls) locks
> all the pages when it tries to synchronzie the disk and memory images. If
> this is what it going on it would be nice if the kernel would not try to
> flush diry file pages if they had been accessed in the last second or so.
Dirty file mmapped pages are only ever written back if the system calls
try_to_swap_out, which happens only in low-memory situations. If your map
really did fit into physical RAM, the data would never get written back
until you unmap the file or exit the program.
It could hit one of the filemap bugs when it unmaps the area and starts
writing out the dirty pages, though.
Bernd