Monitors (contd.)
If the data in a monitor represents some resource, then the monitor provides mutual exclusion facility for accessing the resource.
A monitor must include a synchronization method. What is purpose of this requirement?
ANS: If a process in a monitor is waiting for a condition, not only is that process to be suspended, but it should also release the monitor so that some other process can enter it. When the condition for which the process is waiting is satisfied, it is resumed inside the monitor where it left off.
Monitors support synchronization by supporting condition variables that are accessible only inside the monitors.