BCA-OS


The Process
 A process is a program in execution. A process is more than a program code sometimes known as text section. It also includes the current activity as represented by the value of the program counter and the contents of the processor’s registers. A process generally also includes the process stack which contains temporary data and a data section which contains global variables. A process may also include a heap which is memory that is dynamically allocated during process run time.
                                 Program itself is not a process, a program is a passive entity such as a file containing a list of instructions stored on disk  whereas process is an active entity with a program counter specifying the next instruction to execute and a set of associated resources. A program becomes a process when an executable file is loaded into memory. Although two processes may be associated with the same program, they are considered two separate execution sequences. For instance,
several users may be running different copies of the mail program, or the same user may invoke many copies of the web browser program. Each of these is a separate process; and although the text sections are equivalent, the data, heap, and stack sections vary. It is also common to have a process that spawns many processes as it runs.

Process State:
                        As a process executes, it changes state. The state of a process is defined in part by the current activity of that process.

Diagram_of_Process_State.png

Each process may be in one of the following state:

·         New: The process is being created.
·         Running:The instruction are being executed.
·         Waiting:The process is waiting for some event to occur.
·         Terminated: The process has finished execution.

These names are arbitrary and they vary across operating systems. The states that they represent are found on all systems, however. Certain operating systems also more finely delineate process states. It is important to realize that only one process can be running on any processor at any instant. Many processes may be ready and waiting, however. The state diagram corresponding to these states is presented above.

Process Conrol Block:
                                    Each process is represented in the operating system by a process control block(PCB)- also called a task control block. A PCB is shown below:


 
Process State
Process Number
Program Counter
Registers
Memory limits
List of open files
…………..
                Process Control Block
It contains many pieces of information associated with a specific process, including in above figure of Process Control Block.

·         Process State: The state may be new, ready, running, waiting, halted and so on.
·         Program counter: The counter indicates the address of the next instruction to be executed for this process.
·         CPU Registers: The registers vary in number and type, depending on the computer architecture. They include accumulators, index registers, stack pointers and general purpose registers, plus any condition code information. Along with  the program counter, this state information must be saved when an interrupt occur, to allow process to be continued correctly afterward.
·         CPU scheduling Information: This information includes a process priority pointer to scheduling queues, and any other scheduling parameters.
·         Memory Management Information: This information may include such information as the value of base and limit registers, the page tables or the segement tables, depending on the memory system used by the operating system .
·         Accounting Information: This information includes the amount of CPU and real time used, time limits, account numbers, job or process number and so on.;
·         I/O Status Information: This information includes the list of I/O devices allocated to the process, a list of open files and so on.



No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...
Related Posts Plugin for WordPress, Blogger...
Related Posts Plugin for WordPress, Blogger...