Monitor Synchronization in OS

Monitor Synchronization:

A monitor is a collection of procedures, variables and data structures that are all grouped in special kinds of modules or packages. Monitors have an important property that makes them useful for achieving mutual exclusion: Only one process can be active in a monitor at any instant. It has the following syntax:

[c]
Type monitor_name=monitor
Variable declarations
Procedure entry p1(…..);
begin
……..
……..
……..
end;
Procedure entry p2(…..);
begin
……..
……..
……..
end;
Procedure entry pn(…..);
begin
……..
……..
……..
end;
begin
initialization code;
end;
[/c]