A monitor is a collection of procedures, variables, and data structures that are all grouped together in a special kind of module or package.
Processes may call the procedures in a monitor whenever they want to, but they cannot directly access the monitor's internal data structures from procedures declared outside the monitor. Figure shows illustrates a monitor written in an imaginary language, Pidgin Pascal. C cannot be used here because monitors are a language concept and C does not have them.
Monitor example
integer /;
condition c;
procedure producer();
.
.
.
end;
procedure consumer ();
.
.end;
end monitor;