IPC questions test whether you know who moves the data and who handles synchronization, the kernel or the communicating processes. If shared memory and message passing feel interchangeable, the blocking and buffering cases soon become confusing.
Separate the two models first. Pipes, mailboxes and send-receive classifications then fit into a much simpler picture.
1. Why IPC exists
Processes normally have separate address spaces. A variable belonging to process A is not an ordinary variable that process B can read. This isolation protects processes, but cooperating programs still need to exchange data and coordinate their actions.
Inter-process communication provides that controlled connection. At textbook level, there are two fundamental models:
Shared memory: both processes access a region mapped into their address spaces.
Message passing: processes exchange data through communication primitives such as
send()andreceive().
Named facilities such as pipes, FIFOs, message queues and shared-memory segments can be classified using these models. The exam often gives a property first and asks you to identify the facility or model.
2. The shared-memory model
The operating system establishes a shared region and maps it into the participating processes. After setup, the processes read and write the region using ordinary memory operations. They do not need a kernel-mediated message transfer for every access, which makes shared memory attractive for large data exchanges on one machine.
Speed creates responsibility. If process A writes while process B reads the same location without coordination, the result can depend on timing. The kernel created the mapping, but it does not automatically protect the program's data structure. The programmer must impose mutual exclusion and ordering with mechanisms such as semaphores or mutexes, so every shared-memory design carries a process synchronization and semaphores problem inside it.
A common pattern is to store data in the shared region and use semaphores only for the control events. That separates bulk transfer from synchronization.
3. The message-passing model
Message passing exposes operations such as send(destination, message) and receive(source, message). In the usual operating-systems model, communication goes through a kernel-managed channel. That adds per-message overhead but avoids a data structure that both processes can modify directly.
Communication can use two naming schemes:
Direct communication: the sender or receiver names the peer process.
Indirect communication: both use a mailbox or port rather than naming each other.
The link also has a buffering capacity:
Zero capacity: there is no queue. A send must meet a receive, producing a rendezvous.
Bounded capacity: a fixed queue holds messages. A sender can wait when it is full.
Unbounded capacity: the conceptual queue has no effective limit, so the sender does not wait for lack of space.
Message passing is the natural model across machines because separate computers do not share ordinary physical memory.

The two models split on five questions, and almost every IPC question in an exam is one of them in disguise.
Question | Shared memory | Message passing |
|---|---|---|
Who moves the data? | The processes themselves, with ordinary loads and stores into the mapped region. | The kernel-managed channel, once for every message. |
Who provides synchronization? | You do. A semaphore or mutex has to guard every compound update. | The channel does, through the blocking rules of send and receive. A zero-capacity link forces a rendezvous. |
What does each transfer cost? | Set up the mapping once, then no kernel involvement per access. | Kernel work on every send and every receive. |
Does it work across machines? | Not in the ordinary sense, because two machines share no common physical memory. | Yes, because a message can cross a network. |
Which facility is it? | A shared-memory segment. | A message queue, mailbox or port. A pipe is the byte-stream case. |
4. Blocking versus non-blocking send and receive
Blocking describes whether the calling process must wait.
A blocking send waits until the communication condition defined by the system is satisfied. In the zero-capacity case, that means meeting a receiver.
A non-blocking send returns control to the sender immediately after initiating or depositing the message.
A blocking receive waits until a message is available.
A non-blocking receive returns immediately, with a message if one is ready and a null or empty indication otherwise.
Do not infer one side from the other. A send and receive can each be blocking or non-blocking. The named case to remember is blocking send plus blocking receive on a zero-capacity link. Neither side can complete the exchange alone, so they rendezvous.

5. Pipes and the producer-consumer link
An ordinary anonymous pipe is a unidirectional byte stream. Related processes, commonly a parent and child, can use it because they inherit or otherwise share the relevant file descriptors.
A named pipe, or FIFO, has a file-system name. Unrelated processes can open that name, so they do not need an inherited descriptor. The FIFO entry can persist in the file system even though bytes are consumed from the communication stream.
The bounded-buffer model explains pipe behaviour. The writer is a producer and the reader is a consumer. When the pipe buffer is full, a blocking writer waits. When it is empty, a blocking reader waits. This is the classic producer-consumer problem expressed through an OS facility.
6. IPC true or false: six statements adjudicated
Judge each statement from the model, not from a memorised keyword.
"Shared-memory IPC is generally faster than message passing for large transfers on one machine." True. After the mapping is created, data can be read and written without a kernel-mediated copy for every logical access. Message passing handles each message through the communication mechanism.
"In shared-memory IPC, the kernel guarantees mutual exclusion on the shared region." False. Creating the mapping does not make a compound update atomic. The program needs a semaphore, mutex or another synchronization design.
"An anonymous pipe can be used directly between two completely unrelated processes." False in the standard model. An anonymous pipe depends on shared file descriptors, usually inherited through process creation. A named FIFO gives unrelated processes a common name to open.
"Blocking send and blocking receive over a zero-capacity link form a rendezvous." True. With no queue, the message cannot wait between them. The sender and receiver must meet at the communication point.
"Message passing is preferable to ordinary shared memory in a distributed system." True. Processes on separate machines have no common ordinary address-space region, while messages can cross the network.
"A non-blocking receive always returns a valid message." False. It returns immediately. If no message is ready, it returns the defined null or empty indication.
The statements keep returning to three questions: Is there a shared region? Is there a buffer? Does this call wait?
7. How GATE tests IPC and the common traps
GATE can ask you to match a facility to a model, classify a send-receive pair, reason about zero or bounded capacity, or identify which process blocks in a pipe. The traps are consistent:
assuming shared memory is automatically synchronized
assuming every pipe connects unrelated processes
treating non-blocking as "always succeeds with data"
confusing no buffer with an unlimited buffer
assuming a message operation's name alone tells you whether it blocks
Classification questions reward drilling rather than rereading. The Operating Systems question bank carries over 2,000 questions, more than 200 of them on process synchronization alone, and the GATE Test Series puts them under a clock. The subject list and the marks split for your cycle are published on the official GATE portal.
8. The short version and your next step
Shared memory is fast for large local transfers, but your program must synchronize access. Message passing uses kernel-managed communication and works naturally across machines. A pipe is a bounded producer-consumer stream, anonymous for processes sharing descriptors and named when unrelated processes need a common FIFO.
Next, take the two topics this one leans on: the synchronization mechanics that make shared memory safe, then the readers-writers and dining-philosophers problems that put those mechanics to work. For the whole Operating Systems sequence in prerequisite order, GATE Guidance by Sanchit Sir is built that way, and the GATE category holds the rest of the subject.




