Sunday, 12 August 2012

Operating System (Process.)


                             PROCESS

                                     Process is the term which we always use when we work on a computer application. In our daily life we use process or program in the same term but it is not correct. “Program is a set of instruction which always remains in passive mode in the secondary memory.”  Then what is process ? how it is differ from a program ?
Process is a program in execution. Imagine that we have written a program called prog1.c in C. On execution, this program may read in some data and output some data. But we have to note that when a program is written and a file is prepared, it is only a passive script i.e, it cannot cause any input processing or output to happen. Once we compile, and still later when we run this program, the operations take place. In other view, a program is a text script with no dynamic behavior. When a program is in execution, the script is acted upon. It can result some processing and  I/O operations. It is for this reason a process is differentiated from program. While the program is a text script, a program in execution is a process.
A process passes through different state throughout its life cycle. There are five states of a process:
                                             1)    New
                                             2)    Ready
                                             3)    Waiting
                                             4)    Running
                                             5)    Terminated

new: The process is being created.
running: Instructions are being executed.
waiting: The process is waiting for some event to occur.
ready: The process is waiting to be assigned to a processor.
terminated: The process has finished execution

                                                        The process passes in a managed way from one state to another state throughout its life cycle. There are different data structures at the different state to manage the list of process. In general an OS may use more than one data structure in the management of processes. It may maintain a queue for all ready to run processes. It may maintain separate queues for blocked processes. It may even have a separate queue for each of the likely events ( according to  I/O).




                                                           ........ to be continued                                                              R.P




No comments:

Post a Comment