3. • Program under execution is known as Process.
• Program is passive entity stored on disk
(executable file), process is active.
– Program becomes process when executable file
loaded into memory
• Execution of program started via GUI mouse
clicks, command line entry of its name, etc
4. In a multitasking computer system, processes may occupy a
variety of states. These distinct states may not be
recognized as such by the operating system kernel.
However, they are a useful abstraction for the
understanding of processes.
Execution Condition –
• It should reside in main memory(primary m/m or RAM).
• It should occupy the CPU to execute instruction.
5. The following typical process states are
possible on computer systems of all kinds.
In most of these states, processes are
"stored" on main memory.
6. 1. NEW /CREATED
When a process is first created, it occupies the
"created" or "new" state.
In this state, the process awaits admission to the
"ready" state.
Admission will be approved or delayed by a long-
term scheduler (LTS) or job scheduler.
NEW LTS READY
7. 2. READY
A "ready" or "waiting" process has been loaded
into main memory and is awaiting execution on
a CPU
In ready state, we will have multiple no. of
processes and one of the processes will be
selected for scheduling on the “running” state.
Short term scheduler (STS) or CPU scheduler
selects one of the processes from ready state nd
allocates CPU for execution.
READY STS RUNNING
8. 3. RUNNING
A process moves into the running state when it is
chosen for execution.
The process is preempted because the OS
decides to schedule some other higher priority
process.
RUNNING READY
9. 4. WAIT OR BLOCK
The running process , sometimes move to wait or
block state because of following:-
Process require I/O operation.
Process request memory and some other resources.
Process wishes to wait for a specific interval of time.
Process waits for message or action from some other
process.
RUNNING
I/O
REQUEST
WAIT or
BLOCK
I/O
COMPLETION
READY
STS
10. 5. TERMINATION
A process may be terminated, either from the
"running" state by completing its execution or by
explicitly being killed.
The underlying program is no longer executing, but the
process remains in the process table as a zombie
process until its parent process calls the wait system
call to read its exit status, at which point the process is
removed from the process table, finally ending the
process's lifetime.
If the parent fails to call wait, this continues to
consume the process table entry.
RUNNING TERMINATION
11. • Two additional states are available for
processes in system.
• In both of these states, processes are "stored"
on secondary memory (typically a hard disk).
12. 1. SUSPEND READY
When the resources are not sufficient to manage
the processes in ready state then some of the
processes will be suspended and move to
‘Suspend Ready’ state.
A process may be swapped out, that is, removed
from main memory and placed on external
storage by the Mid term scheduler(MTS).
MAIN
MEMORY
MTS
SECONDARY
MEMORY
13. 2. SUSPEND AND BLOCK
Also called SWAPPED OUT and BLOCKED.
In this event the process is both swapped out
and blocked.
Although in this case, the process will move to
the blocked state, and may still be waiting for a
resource to become available.
Wait or
block
Suspend
wait or
block