Solutions to Process Interaction Problems

How do we remedy the problems encountered when processes interact?

In order to ensure that processes do not interfere with each other, we need to make sure that no two processes may enter their critical sections at the same time. We must enforce a policy of mutual exclusion when processes enter their critical sections. Before we discuss solutions to process interaction problems, let us take a closer look at mutual exclusion.

Processes running on the same system may want to access their critical sections, or shared resources, at the same time. A mutual exclusion policy would ensure that only one process at a time is in its critical section. For instance, two processes, P1 and P2, are running on the same computer. Process P1 enters its critical section, and before it is done process P2 is scheduled to run. P2 runs until it reaches its critical section, but may go no further until P1 has exited its critical section. In this case, P2 is blocked until P1 leaves its critical section.

Several methods for enforcing mutual exclusion have been devised. These methods can be split into two different catagories according to the behavior of blocked processes. There are those that require busy waiting, and those that do not. In the next few sections, we will discuss these methods, and see some examples of their use in solving problems involving mutual exclusion.

Keep in mind these four conditions, which should be satisfied by any good mutual exclusion method:

  1. No two processes may enter their critical sections at the same time.
  2. No assumptions may be made about speeds or numbers of processors.
  3. No process not in its critical section may block another process.
  4. No process should have to wait forever to enter its critical section.

Now let's look at:

THE RED LINE

Busy Waiting Solutions

Sleep and Wake Up Solutions--

Semaphores

Monitors

Message Passing


             
IPC Home   Subway      Process    Problems
  Page       Map     Interaction