Summary

This chapter looked at the UNIX facility that is available for memory-mapped files. This facility provides some interesting new choices to the application programmer.

However, be aware that memory mapping is often restricted to files and memory regions of less than 2GB (FreeBSD release 3.4 restriction). On any given platform, you are restricted to the process memory image size.

If you use memory-mapped files to share information between separate processes, remember that semaphores and calls to msync(2) may be required for synchronization. If you use some of the more exotic mmap(2) features, your application may not be portable to other UNIX platforms.

Despite these challenges, memory-mapped files can be an extremely efficient way to work ...

Get Advanced UNIX Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.