Questions: Inter-Process Communication (IPC)

5 questions to test your understanding

Score: 0 / 5
Question 1 Multiple Choice

A developer uses POSIX shared memory to share a large data structure between two processes but implements no locks or semaphores. This design will most likely result in:

ACorrect behavior — shared memory handles access coordination automatically through the OS
BA compilation error — the POSIX API requires synchronization primitives to be declared at allocation time
CRace conditions — both processes access the same memory concurrently without coordination, risking corrupted or inconsistent data
DA kernel panic — the OS detects unsynchronized access to shared memory and terminates the processes
Question 2 Multiple Choice

Why does a Unix pipe block the writer process when the pipe buffer is full?

ATo prevent the kernel from allocating memory beyond the system's physical capacity
BTo implement automatic flow control, preventing a fast producer from outrunning a slow consumer
CBecause the read end of the pipe has closed, signaling the consumer has finished
DBecause pipes hold only a single message at a time and must be emptied before the next write
Question 3 True / False

Message passing through pipes is generally faster than shared memory for exchanging large amounts of data, because the kernel manages most data movement.

TTrue
FFalse
Question 4 True / False

Standard Unix pipes are bidirectional — a process can both write to and read from the same pipe for two-way communication with another process.

TTrue
FFalse
Question 5 Short Answer

Explain the fundamental tradeoff between message passing and shared memory as IPC mechanisms, and describe when you would choose each.

Think about your answer, then reveal below.