Process coordination consists of synchronization and mutual exclusion,
which were discussed earlier.
We will now study
different techniques for process coordination.
We first make a few definitions related to process coordination.
Instructions that must be executed while another activity is excluded will be called a critical section. For instance in an earlier example we saw that the statement:
A[n++] = itemcould be executed by only one of the processes AddChar1 and AddChar2. This statement is a critical section.
Consider the following situation: Process p1 is in a critical section c1 waiting for process p2 to get out of a critical section c2. Process p2, meanwhile, is waiting for process p1 to get out of c1. Both p1 and p2 are stuck: each is waiting to get into a critical section being executed by the other. This sort of circular waiting is called a deadlock. In Europe, it is known by the more striking name of ``deadly embrace''.
Another problem related to process coordination is starvation. This problem arises when one or more processes waiting for a critical section are never allowed to enter the region.
Different process coordination techniques are often judged on the basis of their
ability to prevent these two problems.