Chapter 9. Shared Memory

One of the main advantages of program threads is that all threads created in one process context share the same address space. This means that all data structures become accessible to them. However, it is not always appropriate for applications to use threads. And in these cases, processes might need to share part of the address space. This can be achieved on both ordinary and realtime kernels by using shared memory.
The original mechanism for sharing a memory region between two processes was the System V IPC shmem set of calls. These calls are quite capable, but overly complicated and cumbersome for the vast majority of use cases. For this reason, they have been deprecated on the Red Hat Enterprise Linux for Real Time kernel and should no longer be used.
Red Hat Enterprise Linux for Real Time uses POSIX shared memory calls, such as shm_open and mmap.

Note

For more information, or for further reading, the following man pages are related to the information given in this section:
  • shm_open(3)
  • shm_overview(7)
  • mmap(2)