Process in Operating System

We all are aware of the computer and the operating system. All the CPU activities that are going on are termed as a process in an operating system. Well, there are several definitions of the term ‘process’ in the operating system.

Like, some call the process a program or an instance of a program that is currently in execution. Some call it an entity that can be executed on the processor. Some call it a unit of activities that contains a sequence of instructions that are in execution.

Concept of Process in Operating System

In the early batch systems, CPU activities are termed as jobs. When it comes to a time-sharing system the CPU activities are termed user programs or tasks. And a single-user system like Windows where even the user is executing one program at a time the CPU is involved in its own programmed activities like memory management. All these activities performed by the CPU are termed as a process.

In the operating system for all CPU, activities are preferred by the term process. The process is not only the set of instructions, which is known as a text section it has many more to concern about. In the section below we have discussed all the elements of the process.

Elements of Process

The two most important components of a process are program code and a set of data. The program code is a set of instructions whereas, the set of data is the collection of data that is associated with the code of the program. Now, consider that the processor starts executing the program code along with the data associated with it then it is called a process.

Well, when the process is in execution it can be characterized by the elements discussed below:

  • Identifier: Every process has a unique identification which helps the processor distinguish between the processes. Every process has a process Id which acts as an identifier for that process.
  • State: A process can be in a ready state, waiting for a state, new state, and terminating state.
  • Priority: There are several processes in the system. But each process must have a priority level which helps the processor in deciding what process should be responded to first.
  • Program Counter: As we have seen a process has a program code that has a set of instructions. The program counter helps the processor to identify which instruction is to be executed next.
  • Memory Pointer: The memory pointer contains the pointer to the program code and to the data that is associated with the program.
  • Context Data: While the process is executing the processor stores the intermediate results in the registers which are referred to as context data.
  • I/O Status Information: A process may require the I/O devices for which it makes the I/O requests. It also has information about the files used by the process.
  • Accounting Information: The accounting information has information about the time spent by the process on the processor.

All this information is organized inside a data structure and it is termed the process control block.

Process Control Block

The operating system creates a process control block for each process. A process control block has all that information about the process which would help the processor to interrupt any process which is currently executing and also resume the interrupted process. The diagram below shows the process control block.

Process in operating system PCB1

The operating system creates as well as manages the process control block. It is all because of the process control block that an operating system has the ability to support multiprocessing.

Process State

From the moment the process is ready for execution and till it gets executed it changes its state. The state of the process can be identified by its current activity. At a time a process can be in only one state. Below are the states of the process.

  • New: A process is in a new state when it is just created.
  • Ready: A process is in a ready state when it is prepared for execution.
  • Running: A process is in the running state when it is instructions are getting executed.
  • Waiting: When the operating system put the process on hold for some time it is in a waiting for the state.
  • Terminated: When the process has completed its execution it gets terminated.

The current state of the process is updated by the operating system in the process control block.

Wrap Up

So, we have discussed a process in the operating system. We have also discussed its characterizing elements. We have also discussed the states of the process and remember at a time process can only be in one state.

Share and Enjoy! 🙂


Leave a Reply

Your email address will not be published.