Experience with processes and monitors in Mesa Lampson, Redell 1980 Summary by Ed Swierk Main idea: Build monitors into the Mesa language as the basic synchronization mechanism for concurrent processes. Goal: Develop a synchronization mechanism general enough to express concurrency in a wide variety of programs, from low-level OS routines to high-level application code. A monitor synchronizes access to shared data by unifying (a) a synchronization mechanism, (b) the shared data, and (c) the code that acts on the shared data. In Mesa, a monitor is an instance of a module, which resembles a Java class with only static variables and static methods. A Mesa monitor has three kinds of procedures: entry procedure: like a synchronized public method in a Java class internal procedure: like a private method in a Java class external procedure: like an unsynchronized public method in a Java class Processes can perform operations on the monitor's data only by calling entry procedures. At most one process can be inside the monitor at any time. If a process is in the monitor, any other process that calls an entry procedure will be delayed. A monitor maintains an invariant that is always true of its data, except when some process is executing in the monitor. An entry procedure must establish the invariant before returning, and a monitor procedure must establish it before doing a WAIT. Nice design aspects: use monitors as the one-and-only synchronization primitive; catch errors at compile time, like using WAIT in an external (unsynchronized) procedure Hacky design aspects: naked NOTIFYs so I/O routines don't have to grab a lock before notifying a waiting thread; no solution (just proposals) for priority inversion; avoiding Hoare notification semantics in favor of better performance Strange design aspects: tons of functionality implemented in hardware (process scheduling, monitor entry/exit, procedure activation record allocation); running the scheduler after every single instruction, so the highest priority ready process is always the one running