Next: Example 1
Up: No Title
Previous: No more milk -
- Critical section or region is the part of a program, where the
program accesses the shared (modifiable) resources
- Only one process can be in the critical section at any one time, hence
the general concept of :
entry protocol
critical section
exit protocol
- Concept of mutual exclusion : processing mutually agreeing to
exclude one another (software) to allow the shared resource to be used efficiently -
some solutions are enforced (hardware) however
- Consider the concept of a narrow waterway : Suez Canal, Panama Canal
- Must be carefully coded to prevent one process from sabotaging the machine, and
remaining in the critical section forever
- If a process in mutual exclusion terminates - the operating system must release
the mutual exclusion held by that process
Requirements and Implementation :
- Mutual Exclusion : If process
is executing in its
critical section, then no other process can be executing in that critical section
- Progress : Only processes outside their critical sections can participate
in deciding who will enter the critical section - and selection of a waiting
one cannot be postponed indefinitely. However, processes cannot prevent any process
from entering their critical section if requirements are valid
- Bounded Waiting : There must be a bound on the number of times that other
processes are allowed to enter their critical section, after a process has made a
request to enter is critical section and before that request is granted
- No assumption may be made or should be necessary about the relative speed of
asynchronous concurrent processes
-
Two common algorithms :
- Dekker's Algorithm
- Petersons Algorithm.
Omer F Rana
Tue Feb 11 19:19:09 GMT 1997