Operating Systems | States of a process



Prerequisite – Introduction, Process Scheduler
States of a process are as following:

  • New (Create) – In this step, process is about to be created but not yet created, it is the program which is present in secondary memory that will be picked up by OS to create the process.
  • Ready – New -> Ready to run. After creation of a process, the process enters the ready state i.e. the process is loaded into the main memory. The process here is ready to run and is waiting to get the CPU time for its execution. Processes that are ready for execution by the CPU are maintained in a queue for ready processes.
  • Run – The process is chosen by CPU for execution and the instructions within the process are executed by any one of the available CPU cores.
  • Blocked or wait – Whenever the process requests access to I/O or needs an input from user or needs access to a critical region(the lock for which is already acquired) it enters the blocked or wait state. The process continues to wait in the main memory and does not require CPU. Once the I/O operation is completed the process goes to ready state.
  • Terminated or completed – Process is killed as well as PCB is deleted.
  • Suspend ready – Process that were initially in ready state but were swapped out of main memory(refer Virtual Memory topic) and placed onto external storage by scheduler are said to be in suspend ready state. The process will transition back to ready state whenever the process is again brought onto the main memory.
  • Suspend wait or suspend blocked – Similar to suspend ready but uses the process which was performing I/O operation and lack of main memory caused them to move to secondary memory.
    When work is finished it may go to suspend ready.

CPU and IO Bound Processes:
If process is intensive in terms of CPU operations then it is called CPU bound process. Similarly, If process is intensive in terms of I/O operations then it is called IO bound process.

Types of schedulers:

  1. Long term – performance – Makes decision about how many processes should be made to stay in the ready state this decides the degree of multiprogramming. Once decision is taken it lasts for long time hence called long term scheduler.
  2. Short term – Context switching time – Short term scheduler will decide which process to be executed next and then it will call dispatcher. Dispatcher is a software that moves process from ready to run and vice versa. In other words, it is context switching.
  3. Medium term – Swapping time – Suspension decision is taken by medium term scheduler. Medium term scheduler is used for swapping that is moving the process from main memory to secondary and vice versa.

Multiprogramming – We have many processes ready to run. There are two types of multiprogramming:

  1. Pre-emption – Process is forcefully removed from CPU. Pre-emption is also called as time sharing or multitasking.
  2. Non pre-emption – Processes are not removed until they complete the execution.

Degree of multiprogramming –
The number of process that can reside in the ready state at maximum decides the degree of multiprogramming, e.g., if degree of programming = 100 means 100 processes can reside in the ready state at maximum.



My Personal Notes arrow_drop_up


Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



Improved By : kbapat

Article Tags :
Practice Tags :



Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.