Continuing off where we left of in Part I, we classify the way in which process interact with each other on the basis of the degree of awareness.
It is productive to examine each of the three items in the preceding list separately and determine their implications for the OS.
Concurrent processes come into conflict with each other when they are competing for the use of the same resource. In the case of competing processes three control problems must be faced.
Suppose we have $n$ processes to be executed concurrently, accessing the same resource Ra
.
Figure 5.5 Illustration of mutual exclusion.
It is desired that only one process at a time be in its critical section, so two functions are provided: entercritical
and exitcritical
. If another processes is using the same resource, it is made to wait.
Multiple processes may have access to shared variables or to shared files or databases. Thus the processes must cooperate to ensure that the data they share are properly managed.