0% found this document useful (0 votes)
29 views

Monitors

1) A monitor is a software module that allows for safe sharing of an abstract data type among concurrent processes through controlled access via procedures. 2) Only one process can execute in the monitor at a time, and local variables are only accessible by the monitor. 3) Condition variables declared within monitors allow processes to wait and be signaled, with wait suspending a process until another process performs a signal.

Uploaded by

Vinitha Arun
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views

Monitors

1) A monitor is a software module that allows for safe sharing of an abstract data type among concurrent processes through controlled access via procedures. 2) Only one process can execute in the monitor at a time, and local variables are only accessible by the monitor. 3) Condition variables declared within monitors allow processes to wait and be signaled, with wait suspending a process until another process performs a signal.

Uploaded by

Vinitha Arun
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 7

Monitors

By
P.Vinitha
Monitors
• Monitor is a software module
• Chief characteristics
Local data variables are accessible only by the
monitor
Process enters monitor by invoking one of its
procedures
Only one process may be executing in the
monitor at a time
Monitors
• High-level synchronization construct that allows the safe sharing of
an abstract data type among concurrent processes.
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
Monitors (Cont.)
• To allow a process to wait within the monitor, a condition
variable must be declared, as
var x, y: condition
• Condition variable can only be used with the operations wait
and signal.
The operation
x.wait;
means that the process invoking this operation is suspended until
another process invokes
x.signal;
The x.signal operation resumes exactly one suspended process. If no
process is suspended, then the signal operation has no effect.
Schematic view of a monitor
Monitor with condition variables

You might also like