Monitors
Class where only one procedure runs at a time
Possibly less error prone than Mutex, but also less flexible
monitor monitor-name {
// Shared varaible declarations
procedure P1(...) {...}
...
procedure Pn(...) {...}
Initialization code(...) {...}
}
Implementation
- Queue of threads waiting to get in
- Might be protected by Spinlock
- Queues insides are associated with conditions
- implements CV