Shared Memory

Shared memory is an efficient way to share data among different processes.

Sharing memory is a common feature in operating systems that support separate address spaces for different processes. Uses include:

Additional use cases for a microkernel OS such as QNX Neutrino include:

Instead of sharing memory, you could use:

However, shared memory is usually more efficient, especially with large amounts of data. In addition, software that's ported from other OSs doesn't use QNX Neutrino's message passing and frequently uses shared memory.

Shared memory objects that are populated with shm_ctl() are implicitly locked, unless you use the SHMCTL_LAZY flag.