CyberArmy University | Open Source Institute | CyberArmy Intelligence & Security | CyberArmy Services & Projects

[Library Index]

[View category: Operating Systems] [Discuss Article]

Understanding Processes

Article is yet to be rated
Author:      Rae
Submitted:      28-Apr-2007 19:41:02
Imported From:      The CyberArmy University (original author: rae)


Understanding Processes
A process is a program in execution. It is different from a program in the sense that unlike a program it competes for resources from the CPU like execution time, memory etc. Some people use the term 'job' for process, but it essentially means the same thing. A process which executes undergoes various stages or states. Some of the basic ones are,

- New : the state when a process is just created.
- Ready : the state when a process is waiting to be assigned CPU execution time.
- Running : the state when the process is actually executing.
- Waiting : the process is waiting for an external event to occur.
- Terminated : the state used to signify the end of a process.

A little point of clarification here, some classical texts also refer to the waiting state as 'blocked'. And with respect to the same state, external event usually means I/O completion. Depending upon the number and type of schedulers implemented in the system, some new states may be defined. But the above mentioned are the basic states, and the list has been kept to a minimum to induce simplicity and clarity.

All the important information about a process is kept in a special data structure called the 'Process Control Block' or PCB. These PCB's are stored in the memory area reserved for the operating system. The PCB's are created when the process is created and destroyed when the process exits. In other words they have a lifetime from the time when the process enters the 'new' state till it reaches the 'terminated' state.

In a multiuser or a multitasking system, more than one user processes may run at the same time. For administration of such a task, a process management module is defined. It is basically divided into two sub-modules, the traffic controller and the process scheduler. The main functions of this module are,

- Keeping a track of the status of the processes, as in which state they are in currently.
- Choosing which process will get CPU time next.
- How long will the process will be allowed to execute?
- Allocation and deallocation of resources based upon which state a process is in.

The PCB is nothing but a data structure consisting of some relevant data record fields. Some of the important fields are Process Identifier (PID), Process state, priority, Register save area, pointers to memory and other resources and list of open files. A PID is a number allocated to a process upon its creation. It uniquely identifies the process and is used for carrying out any operation on the process. It is important to remember that the PID cannot be same for two processes. To see the PID of a process in UNIX or LINUX, use the 'ps' command. The 'kill' command which is used to terminate a process, also uses the PID.

References :-

Operating Systems Concepts by Silberschatz and Galvin
Modern Operating Sytems by Gary Nutt
Written by Rae of OPERATION COMMLINX
Edited by NeorageX June 9, 2005

This article was originally published by CyberArmy.net in the CyberArmy Library.

You must be logged in to vote on an article

About Us | Privacy Policy | Mission Statement | Help