Monitor is an Interprocess Communication (IPC) technique which can be…
2014
Monitor is an Interprocess Communication (IPC) technique which can be described as
Answer: A. It is higher level synchronization primitive and is a collection of procedures, variables, and data structures grouped together in a special package. — Monitor: definition and key properties A monitor is a high-level synchronization construct that encapsulates shared data, the procedures that operate on that…
- A.
It is higher level synchronization primitive and is a collection of procedures, variables, and data structures grouped together in a special package.
- B.
It is a non-negative integer which apart from initialization can be acted upon by wait and signal operations.
- C.
It uses two primitives, send and receive which are system calls rather than language constructs.
- D.
It consists of the IPC primitives implemented as system calls to block the process when they are not allowed to enter critical region to save CPU time.
Attempted by 80 students.
Show answer & explanation
Correct answer: A
Monitor: definition and key properties
A monitor is a high-level synchronization construct that encapsulates shared data, the procedures that operate on that data, and synchronization mechanisms into a single module.
Key properties:
Automatic mutual exclusion: only one thread can execute inside the monitor at a time, preventing concurrent access to the monitor's shared data.
Encapsulation: shared variables are accessible only through the monitor's procedures, reducing the risk of incorrect direct access.
Condition variables with wait and signal: monitors provide language-level condition variables to block and wake threads inside the monitor in a structured way.
Higher-level than semaphores: monitors reduce common errors and improve modularity compared with low-level primitives like semaphores.
How it differs from other IPC/synchronization mechanisms:
Semaphores are integer counters manipulated by wait and signal operations and are lower-level; they do not provide encapsulation or automatic mutual exclusion by themselves.
Message passing uses send and receive primitives to exchange data between processes; it is a communication model rather than a language-level synchronization wrapper around shared data.
OS-level blocking system calls can block processes when waiting for resources, but monitors provide structured, language-level coordination through condition variables rather than generic system call blocking.
In summary: A monitor is a high-level synchronization primitive that groups procedures, variables, and data structures into a single package while providing automatic mutual exclusion and condition-variable-based coordination.