Semaphores
upc_lock_attempt()upc_lock()Class exercise
0 <= s1+s2 <= 1
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 |