mmap, msync(MS_ASYNC) and munmap
问题 If I call msync with MS_ASYNC on a memory mapped region, the sync process will be handled asynchronously. However, if I call munmap immediately on that region, can I assume that the msync will be carried out safely? Or will I have to call msync before munmap? 回答1: The short answer is yes -- the changes to the contents will eventually (and safely) make their way to the file, even if you never call msync . From man 2 mmap : MAP_SHARED Share this mapping. Updates to the mapping are visible to