Hello Friends, In this blog post I am going to let you know about the process and different types of process states which are used in the operating system.
A process is a program in execution. It consists of an executable program, the program’s data and stack, it’s program counter, stack pointer, and other registers, and all the other information needed to run the program.
A program by itself is not a process. A program is a passive entity, such as the content of a file stored on disk whereas a process is an active entity, with a program counter specifying the next instruction to execute and a set of associated resources.
States of the process/ How many states are there in the process?/ What are the 5 basic states of a process?
A process goes through a series of discrete process states. various events can cause a process to change states. The state of a process is defined in part by the current activity of that process. A process may be in one of the following states:
New: The process is being created.
Running: Instructions are being executed.
Waiting: The process is waiting for some event to occur such as an I/O completion or reception of a signal.
Ready: The process is waiting to be assigned to a processor.
Terminated: The process has finished execution.
A state diagram corresponding to these states is shown in fig 1 below.
Process control block:
Each process is represented in the operating system by a process control block (PCB) or a task control block. A PCB is shown in fig 2.
It is a data structure containing certain important information about the process including the following.
Process state: The state may be new, ready, running, waiting, halted and so on.
Program counter: The counter specifies the address of the next instruction to be executed for this process.
CPU Register: 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 to continue the process correctly afterward, when an interrupt occurs.
CPU – Scheduling information: It includes a process priority, pointers to scheduling queues, and any other scheduling parameters.
Memory Management Information: It includes information such as the value of the base and limit registers, the page tables, or the segment tables, depending on the memory system used by the operating system.
Suspend(Processname): Ready -> suspended ready
A suspended ready process may be made ready by another process. It makes the transition.
Resume(Processname) : suspended ready -> ready
A blocked process may be suspended by another process. It makes the transition.
Suspended(Processname): blocked -> suspended blocked
A suspended blocked process may be resumed by another process. It makes the transition.
Resume(Processname) : suspended blocked -> blocked
In the case of any queries, you can write to us at [email protected] we will get back to you ASAP.
Hope! you would have enjoyed this post about the process and its different types of states in the operating system.
Please feel free to give your important feedbacks in the comment section below.
Have a great time! Sayonara!