Principles of Concurrency

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.

  1. Processes unaware of each other: These are independent processes that are not intended to work together.
  2. Processes indirectly aware of each other: These are processes that are not necessarily aware of each other by their respective process IDs but that share access to some object.
  3. Processes directly aware of each other: These are processes that are able to communicate with each other by process ID and that are designed to work jointly on some activity.

It is productive to examine each of the three items in the preceding list separately and determine their implications for the OS.

Cooperation among Processes by Resource

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.

  1. The need for mutual exclusion. It is important that only one program at a time be allowed in its critical section.
  2. The enforcement of mutual exclusion creates two control problems:
    1. Deadlock.
    2. Starvation.


Suppose we have $n$ processes to be executed concurrently, accessing the same resource Ra.

Figure 5.5 Illustration of mutual exclusion.

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.

Cooperation among Processes by Sharing

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.