Which mechanism allows processes to exchange data and messages directly?
2024
Which mechanism allows processes to exchange data and messages directly?
- A.
Semaphores
- B.
Shared memory
- C.
Pipes
- D.
Signals
Attempted by 11 students.
Show answer & explanation
Correct answer: B
Shared memory is the correct mechanism because it allows multiple processes to access a common region of physical memory, enabling them to exchange data directly without the overhead of kernel-mediated copying. When processes map the same memory segment, they can read and write data instantly, making it highly efficient for high-volume communication. In contrast, semaphores are synchronization primitives used to control access to shared resources but do not transfer data themselves. Pipes facilitate communication through a unidirectional byte stream, typically requiring the kernel to buffer and relay data between processes rather than allowing direct access. Signals are asynchronous notifications used to alert a process of an event but carry minimal data payload, making them unsuitable for direct message exchange. Therefore, shared memory uniquely supports the requirement of direct data and message exchange between processes.