Sunday, May 31, 2009

Concept of Process

In simple terms we can say that a process is a program in execution. A process is not only the program code which is known as text section. A process can also include the program activities which are represented by the program counter and processor’s registers. A process also includes a stack that contains the temporary data like function parameters,return addresses and local variables and a data section that contains the global variables.A process also contains a heap which is the memory that is allocated dynamically to the process during its creation and execution.

Here,one thing that you had to make very much clear in your mind is that a process can never be a program because a program is a passive entity and a process is an active entity. A program becomes a process when it is loaded into memory.The most common technique that is used for loading a program into main memory is by double clicking on that icon or you can type the name of that program on the command line.It is possible that two or more than two processes are associated with a program but this does not mean that they are different execution sequences.For instance,several users may running different copies of the same email program, or the same user may invoke different instances of the web browser.Each of these is a separate process and although the text sections are equivalent while the stack and heap sections may vary.