How can monitors be provided as a programming language feature?
Monitors are high-level synchronisation primitives. They are an encapsulation of procedures, variables and data structures. Processes cannot directly access these data structures. They must use the procedures provided by the monitors. Monitors ensure mutual exclusion by having only one process active inside it at a time.Monitors must be provided as a feature of the programming language so that the compiler can treat calls to monitor procedures differently from calls to ordinary procedures. Typically the compiler will generate code for these calls which will include instructions to check that there are no other processes active in the monitor already, and suspend the calling process if there are any. Otherwise the calling process may be allowed to enter the monitor.It is the responsibility of the compiler to arrange for mutual exclusion. The calling process is not aware of how this is to be achieved. They can be suspended and made to _wait_ on a variable, which will _signaled_ by the pr