Monitors and Semaphores
Monitors and Semaphores can be implemented in terms of each other. E.g., to implement monitors with semaphores, we need:
- mutex : a sema to control entry to the monitor (init to 1)
- next : a sema to suspend a process when it signals another (init to 0)
- next-count : integer # of processes waiting due to signals
- x-sem : a sema to suspend a process on a wait (init to 0) [one semaphore for each condition]
- x-count: integer # of proc. waiting due to waiting on condition [one for each condition]