Header Ads

What is a process. Explain with its state and operations.

Process

A process can be termed as a program in execution. It is the smallest unit of work that can be scheduled by an operating system. Such an operating system is a collection of processes that must be executed in sequential order. The concurrent execution results in the increased performance, proper utilization of resources and efficiency and responsiveness of the system. The operating system follows and executes all the process one by one concurrently.

Features of a process 

  • It is a static object.
  • It is loaded into secondary storage devices.
  • Its life span is infinity.
  • It is a passive entity.
  • It is always executed sequentially.
A deadlock is a condition where a process is waiting for a triggered event caused by another process.
When some set of processes in many allocation strategies are ignored due to their comparatively low priority then this phenomenon is called starvation.

Process States

The state of the process changes simultaneously as it comes in execution. Each process is in one of the following mentioned states when it is to be executed.
The states of process and its description are as follows:
1. New: It is the first state in which the process is being created or is started.
2. Ready: In the second state the process is waiting for the processor so that it can be assigned to it. The process could be in this state when its interrupted by the scheduler to assign CPU to other process(es).
3. Waiting: In the third state the process is waiting or is blocked for some specific event to occur, that can be I/O completion or reception of a signal.
4. Running: In the fourth state the process is being executed by the operating system scheduler after assignation.
5. Terminated: In the last fifth state the process has finished the execution and hence is terminated. In the terminated state the process waits to be removed from the main memory.

Operation on process

There are many processes to be executed by a single CPU, to tackle this multitasking and time-sharing is used which is also known as concurrent sequential processing. The various operations that can be done on processes are as following:
  1. Process creation
  2. Process termination
  3. Process running
  4. Change in process priority
  5. Getting process information
  6. Setting process information
We will discuss about the first two main operations of process.
1. Process creation: The task of process creation is done by the operating system. It can be done by the following ways:
  • In response to the submission of a job a process is created for a batch environment.
  • A process is created when user attempts to log in, in interactive environment.
  • The operating system creates a process on behalf of user program to perform a function.
2. Process termination: A process can be terminated normally or by force.
  • In normal termination, is done with the help of existing system call by returning output to parent process. 
  • In forced termination, parent process id used to abort a system call.

Process control block (PCB)

Process control block/process descriptor is the representation of a process in an operating system. The PCB includes several information about specific process such as:
  • The processor in which the process is running on.
  • It includes pointers that points towards the memory of the processes.
  • The priority of the process.
  • It includes a pointer to its child process if any.
  • Unique identification of the process that is used to differentiate between the information for tracking purposes.

No comments:

CSE Solved. Powered by Blogger.