So we had a brief introduction of what is meant by a program process and thread. Now we can discuss about process in detail. In our computer we have programs like MS Word Google Chrome etc stored in our secondary Storage, now when we run a program the program is loaded into the main memory which is our RAM now we call it as a Process
A process mimics a processor in properties and holds a set of registers ,process status, program counter, stack and the code for the corresponding process.Thus a process inherit all the properties of the CPU so we can consider a process as a virtual processor awaiting its turn to have its properties switched into the physical processor.
When the process gets its turn its registers and program counter becomes mapped into physical registers of the CPU. The memory occupied by the process is segregated into three regions..
A process mimics a processor in properties and holds a set of registers ,process status, program counter, stack and the code for the corresponding process.Thus a process inherit all the properties of the CPU so we can consider a process as a virtual processor awaiting its turn to have its properties switched into the physical processor.
When the process gets its turn its registers and program counter becomes mapped into physical registers of the CPU. The memory occupied by the process is segregated into three regions..
- Stack Memory- to hold temporary data such as variables locals to the process.
- Data Memory - to hold all global data for the process.
- Code Memory- contains the program code corresponding to the process.
When a process starts, it is assigned memory and resources.
Process Life Cycle- Process States or Task States
On a computer system with only one processor, only one task can run at any given time, hence
the other tasks must be in some state other than running. The number of other states, the names
given to those states and the transition paths between the different states vary with the operating
system.
PROCESS STATES AND STATE TRANSISTION |
Diagram above gives a generic representation of different states associated with the process
Created state: this state is also known as the new state. in some real time operating systems like the MicroCOS, the new state is represented as Dormant State.-- a process is recognized by the OS, but no resources are allocated to the process
Ready state: the process is intercepted into the memory and is waiting for the processor time for its execution. There may be several task in this state.The process is kept in the OS Ready queue
Running state:- the state where the instruction corresponding to the process is being executed this is the task which has control of the CPU. Normally it is the task which has highest priority among the current task which are ready to run.
Blocked state/ Wait State:- When a process is temporarily suspended from execution then its state changes to blocked state this might occur when the process lacks an input or it is waiting for getting access to a shared resource. This can also occur when a high priority task stops a low priority task from execution and takes control of the CPU.
Completed State :- when the process completes execution
Under VxWorks Kernel Task States are represented by : READY PEND DELAY SUSPEND
MicroCOS : DORMANT, READY, RUNNING , WAITING OR INTERRUPTED
Created state: this state is also known as the new state. in some real time operating systems like the MicroCOS, the new state is represented as Dormant State.-- a process is recognized by the OS, but no resources are allocated to the process
Ready state: the process is intercepted into the memory and is waiting for the processor time for its execution. There may be several task in this state.The process is kept in the OS Ready queue
Running state:- the state where the instruction corresponding to the process is being executed this is the task which has control of the CPU. Normally it is the task which has highest priority among the current task which are ready to run.
Blocked state/ Wait State:- When a process is temporarily suspended from execution then its state changes to blocked state this might occur when the process lacks an input or it is waiting for getting access to a shared resource. This can also occur when a high priority task stops a low priority task from execution and takes control of the CPU.
Completed State :- when the process completes execution
Under VxWorks Kernel Task States are represented by : READY PEND DELAY SUSPEND
MicroCOS : DORMANT, READY, RUNNING , WAITING OR INTERRUPTED
PROCESS CONTROL BLOCK
Whenever a task is switched its execution context, represented by the contents of the program counter, stack and registers, is saved by the operating system into a special data structure called a task/ process control block so that the task can be resumed the next time it is scheduled.
No comments:
Post a Comment