Shared memory is an IPC mechanism where a region of physical memory is mapped into the address space of multiple processes, allowing direct communication by reading/writing shared locations. Typically the fastest IPC form, avoiding data copying overhead.
Mechanism
Usage Steps
Creation: One process creates a shared memory segment
Mapping: Other processes attach (map) segment into their virtual address space
Access: Processes read/write as if local data
Synchronisation
Manual Synchronisation Required
The OS does not provide automatic protection against concurrent access. Programmers must use synchronisation primitives: