PROCESS STATES

What is process?

The CPU is most important resource of the system and the system has only one CPU. As Linux is a multi-processing operating system which makes the CPU always having a process running on it so that it maximize the CPU utilization. Process is a running instance for a launch of a executable program and it is also known as task. Process consists of:

·         An address space of allocated memory

·         Security properties including ownership credentials

·         One or more execution threads or program code

·         Process states


Process State in Linux

Let’s us now understand different states of process in Linux. Below diagram shows the process states in Linux:

Lets us see each state in brief and try understanding the whole working:

1)      Running (task running)
The process is either executing n the CPU or waiting to run. Process can be executing in user or kernel mode.

2)    Sleeping (waiting)
There are total of 3 types:
S (task interruptible)- the process waiting for some condition like hardware request, system resource excess or signal. When event or signal specify the condition the process return to running.
D (task uninterruptable)- the process is also sleeping but unlike as state S it will not respond to delivered signal. Unless under some specific condition in which process interruption may causes an unpredictable device state.
K (task killable)- uninterruptable like D state but it can be modify to allow the waiting task to respond to a signal to be kill. Utility is frequently display killable process at this state. 

3)    Stop
The process has been stopped (suspended) usually signaled by a user or another signal. The process can be continued (i.e. resume) by another signal to return to running state. 

4)    Zombie 
In this we can classify process in two types:
Z- a child process, signales its parent as it exit or resource accept the process identity are released.
X (dead state)- when the parent process clean up the remaining child process structure. The process is now completed the state and will never be observing the process utilities.

Classification of Process 

Broadly process states are classified in two types which are described below:

Foreground process /Job
Job controlling is the feature of the shell which allow the single cell instance to run and manage multiple commands. A job is associated with each pipeline enter at a shell prompt. Every process in the pipeline is part of the job and is the membered of the process group.

At a time only one job can read input and keyboard can generated signal from a particular terminal window. Processes that are part of that job are foreground process of that controlling terminal.

Background process
A background process of that controlling terminal is a member of any other job associated with that terminal. Background process of a terminal cannot read input or receive keyboard generated interruption from the terminal but may be able to write to the terminal. A process in the background may be stop or running. If a running background process tried to read the terminal it will be automatically suspended.


 







Comments