Monitors
| Semaphore | Monitor |
|---|---|
wait may or may not block | waitC always blocks |
signal always has an effect | signalC has no effect if queue is empty |
signal unblocks an arbitrary blocked process | signalC unblocks the process at the head of the queue |
| a process unblocked by signal can resume execution immediately | a process unblocked by signalC must wait for the signaling process to leave monitor |
Cars coming from the north and south arrive at a one-lane bridge. Cars heading in the same direction can cross the bridge at the same time, but cars heading in opposite directions cannot.