- LPU MCA Semester 1
- CAP366
- Unit 3
CAP366 · Unit 3: Process management
Inter-process communication
10 practice questions · in the MTE and ETE syllabus
Key points
- Two models: shared memory and message passing
- Shared memory needs its own synchronization
- Blocking send and receive = rendezvous
- Ordinary pipe is one-way between related processes
Cooperating processes communicate by shared memory or message passing.
| Model | Strength | Cost |
|---|---|---|
| Shared memory | Fast; kernel needed only to set up the region | Processes must synchronize their own access |
| Message passing | Easy, good for small data and distributed systems | Kernel call for each message |
Message passing can be direct (name the process) or indirect (mailbox/port), and send/receive can be blocking or non-blocking; blocking send plus blocking receive is a rendezvous. A circular bounded buffer using only in/out indices holds at most N - 1 items (10 slots hold 9).
An ordinary pipe is unidirectional and connects related processes (parent and child); named pipes (FIFOs) can connect unrelated ones.
Exam pitfall: a pipe reader sees end-of-file only when every write end is closed, so an unclosed duplicate write end can make the reader block forever.
Try two questions
Which two fundamental models are used for inter-process communication?
- Polling and interrupt-driven I/O
- Paging and demand segmentation
- Spooling and double buffering of I/O
- Shared memory and message passing
Show the answer
D. Shared memory is fast (kernel not involved after setup); message passing is easier for distributed systems.
Which statement about shared-memory IPC is TRUE?
- Processes must synchronize their own access to the shared region
- It works between processes on separate machines linked over a network
- It uses send() and receive() calls handled by the kernel
- The kernel serialises every access to the region for the processes
Show the answer
A. After the region is set up, accesses are ordinary memory operations; synchronization is the programmers' job.