Explain State Transition In Operating System, Process Execution State Transition In Operating System
In This Topic & Blog Having Any Query Then Post your Comment and Suggestion Below
State Transition
As a process executes, it changes state
– new-> Ready: The operating system creates a process
and prepare the process to be executed, then the
operating system moved the process in to “Ready”
queue.
– Ready-> Running: When it is time to select a process to
run. The operating system selects one of the jobs from
the ready queue and move the process from ready state
to running state.
– Running -> Terminated When the execution of a process
has completed then the operating system terminates that
process from running state. Some times operating
system terminates the process some other reasons also
include time limit exceeded, Memory unavailable,
access violation, protection error, I/O failure, data
misuse and so on.
– Running - >Ready: When the time slot of the processor
expired (or) if the processor received any interrupt
signal, then the operating system shifted running
process to ready state. For example process P1 is
executing by processor, in the mean time process P2
generate an interrupt signal to the processor. Then the
processor compare priorities of process P1 and P2, if
P1>P2. Otherwise the processor switched to process P2,
and the process P1 moved to ready state.
– Running -> Waiting: A process is put into the waiting
state, if the need an event occur, or an I/O devices
require. The operating system does not provide the I/O
or event immediately then the process moved to waiting
state by the operating system.
– Waiting - >Ready: A process in the blocked
state is moved the ready state when the event
for which it has been waiting occurs.
Example : a process is in running state need an
I/O device then the process move to blocked or
waiting state when the I/O device provided by
the operating system the process moved to
ready state from waiting or blocked state.
Labels: Operating System