Home » Operating Systems

Process State Diagram in Operating System

In this article, we will study about the Process State diagram which defines the various states in which a process can be while it remains in the main memory. We will first take a look at the diagram and then define each of its components briefly.
Submitted by Monika Sharma, on June 27, 2019

The Process State diagram illustrates the States in which a process can be in, and it also defines the flow in which a particular state can be achieved by the Process. Let us first take a look at the Process State diagram, which is as follows:

process state diagram
  • When a new process is initiated, it is said to be in the new state, which means that the process is under creation.
  • When the process is ready for execution, the long term scheduler transfers it from the new state into the ready state. The process has now entered into the main memory of the system.
  • In the ready state, the processes are scheduled by the short term schedulers, and a queue is maintained in which the processes are serially sent to the processor.
  • After maintaining the queue, the dispatcher then transfers the processes to the running state one by one as per the queue sequence.
  • While being in the running state, the process utilizes the processor. But if there is a requirement of any input or output devices in between the processing, then the process is shifted to the waiting state.
  • When the process is done with the input-output services, then instead of directly going back to the running state, it is again sent to the ready state and is then is scheduled again for going into the running state.
  • This process keeps continuing and when the process completes its execution, it goes into the termination state, which means it exits from the main memory of the system.
  • The black arrow in the diagram, which goes from the running to waiting for state exists only if the operating system follows preemption of processes, i.e. a current running process can be interrupted in between and can be replaced by some other process with high priority. If the OS does not allow preemption, then this switch is not allowed.





Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.





Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates


© https://www.includehelp.com some rights reserved.