äMonitors
äA package of
subprograms with conditions
äconditions are basically semaphores
äSubprograms in the monitor are protected by a single mutex variable so only one caller can enter the monitor at a time
äClients can call the subprograms and then wait on a condition within the monitor
äFor example: cwait
(buffer_full)
äWhen waiting, a client gives up its mutex on the monitor as well
äA new caller may
enter and signal the condition
äFor example:
csignal(buffer_full)
äWhen the new caller leaves the monitor, a single client waiting on buffer_full will resume where it left off
äNote the resumed
client will have mutex over the monitor’s
subprograms