What is a process?
and
Why do processes need to communicate?

A sequential process, or process for short, is simply a running program. Processes are sequential because there is no concurrency within a process, everything happens one after the other. The distinction between a process and a program is important. Processes are more than just a program. For instance, when several people run 'cat' on a UNIX system, they run the same program, but each has a separate process. Also, a single program can create several processes when it is executed.

The part of a computer which performs the action of running a program is called a processor. Modern computers can often run many processes at once. On computers with a single processor, this is achieved by running each process for a certain amount of time, say for tens or hundreds of milliseconds. When a process' time has expired, the state of the process is saved, and another process is scheduled to run. This rapid switching between processes on a single processor is called multiprogramming. True parallelism is possible if a computer system has more than one processor. In either case, processes share common resources, such as a printer, files, memory, and registers.

Why do processes need to interact? Consider the UNIX shell command

 who | wc -l    // returns the number of users on a computer

In this example, the output of the program 'who' is passed to the 'wc' program, i.e. the processes must communicate. Not only do they share data, but the state of one process depends on the other. The 'wc' process needs input before it can run. This means that the first process must run before the second process can begin. In other words, the second process must block until the first process' output is available. A process blocks when it cannot continue, in this case because it is waiting for input.

Processes can be in one of three states at any one time.

   1. Process blocks for input
   2. Scheduler picks another process
   3. Scheduler picks current process
   4. Input becomes available
  

In the following section, we will continue our discussion of process interaction.


        
IPC Home    Subway    Process
    Page       Map    Interaction