Well you all must have heard about process in operating systems? Let us learn what their roles are in operating systems, especially for beginners who are often confused about the roles of a program and process in a system.Â
A process is said to be a sequence of program or instructions in action. Process consists of many components and has an active role in the operating system. Let us get a brief overview of the Process in operating systems in this blog.
What is Process In Operating Systems?
Process in operating systems is an important part which is defined as a sequence of instructions executed in a predefined order. Any program that is executed in an operating system is termed as a process. Processes can either be in ready, running, waiting or terminated states. A process in operating system is managed by the Process Control Block (PCB).
It is a basic unit of work done in an operating system in executing different tasks. There are many components of Process in operating system. Let us get a simple overview of the components in process.
Components of Process In Operating Systems
There are many components in a process of operating system. Let us get familiar with the major components below.
- Program/Code: This contains the program or instruction that process will need to execute based on the set of instructions received.
- Data: This component contains the data that process will be using for execution in the program.
- Stack: Stack is a data structure present in process which is used to store. It is used as a return address in the memory or process which contains function, parameters and return addresses.
- Heap: It is a dynamic data structure used to store the dynamically allocated memory in a process.Â
- Process Control Block: The Process Control Block consists of everything about the process in detail, such as state, priority, usage, program counter, and more.
Read More: Operating System Fundamentals for Beginners in 2025
Life Cycle of A Process in Operating Systems
Let us understand the complete lifecycle of a process in operating systems given below.
1. New State
A process is created when a program is loaded into memory for execution. The OS allocates necessary resources (memory, CPU time, I/O permissions) to the process. If approved, the process moves to the Ready state; otherwise, it is terminated.
Transition In this Stage: New → Ready
2. Ready State
The process is waiting for CPU time to execute and It has all required resources except the CPU. The process scheduler selects a process from the ready queue based on scheduling algorithms like FCFS, SJF, Round Robin, etc.
Transition In this Stage: Ready → Running State
3. Running State
The CPU is executing the process. The process continues execution until:
- It completes execution.
- It is interrupted (e.g., higher-priority process arrives).
- It requests I/O (moves to the Waiting state).
Transition In this Stage: Running → Waiting State
4. Waiting/Blocked State
A process moves to the waiting state if it requests I/O operations (e.g., reading from a disk, network, or user input). The process remains here until the I/O operation is completed. Once ready, it moves back to the Ready state.
Transition In this Stage: Waiting → Ready State
5. Terminated/ Exit State
A process finishes execution or is forcefully stopped due to an error. The OS deallocates resources used by the process.
Transition In this Stage: Running → Terminated State
What is Context Switching in Process?
Context Switching in OS is a condition when the CPU switches from executing one process in the system to the other based on priority or scheduling algorithm. The switch takes place under various situations i,e. When a running process turns on a CPU, Interrupts, a process needs an I/O device, etc.
When a scheduler preempts the currently process running in the system then also context switching takes place in the system.
Read More: Paging in Operating system: Complete Explanation
Components of Process Control Block In OSÂ
The Process Control Block is used to store all information regarding the Operating system. It stores the state, next process, Process ID, and other information of a process.
- Process ID (PID): Unique identifier assigned to the process.
- Parent Process ID (PPID): ID of the process that created this process.
- Current State, such as New, Ready, Running, Waiting, Terminated state of a process.
- Program Counter (PC) stores the address of the next instruction to execute.
- Priority Level determines process execution order.
- Scheduling Algorithms, such as FCFS, Round Robin, Priority Scheduling, etc.
- PCB stores CPU registers, including Accumulator, Base Register, Stack Pointer, etc., which help in context switching.
- Base and Limit Registers is used to define the allocated memory range.
- Page Table or Segment Table is used for virtual memory management.
- List of open files, devices, and I/O requests associated with the process.
- CPU time used, process start time, and other statistics for performance monitoring.
Memory Space In a ProcessÂ
Process in operating systems contains its own dedicated memory space based on different data structures and variables. The data used by one process is stored in a separate designated area as compared to other processes in the system.Â
The Separation in the process ensures that the process cannot accidentally or maliciously access or modify any other process in the system as it might violate the data integrity of the information stored by the users.Â
Difference between Process And Program
Let us understand the common differences between a program and process in operating systems.
Program | Process |
A static set of instructions written to perform a specific task is known as Program. | A dynamic execution of a program in memory is known as Process. |
Program is a Passive – It is just a file stored on disk. | It exists in Active state – It runs in memory and uses system resources. |
Program exists permanently until deleted. | Process exists temporarily until execution is complete. |
It requires no memory until executed. | It requires RAM for execution and resource allocation. |
Program cannot execute on its own. | Process needs CPU to execute the instructions. |
Program containing multiple copies of a program can exist. | Each process is independent and managed by the OS. |
There are no resources allocated. | It requires CPU, memory, I/O devices, and registers. |
A C++ program file (e.g., mycode.cpp) stored on disk is an example of program | Running the compiled program (e.g., a.out executing in RAM) is an example of Process. |
Learn DevOps with PW Skills
Discover a wide range of career opportunities in DevOps and Cloud Computing with the PW Skills DevOps and Cloud Computing Course and master in-demand tools like Ansible, Kubernetes, Jenkins, and more with our interactive coursework, dedicated mentors and more. Get real-world projects, practice exercises, module assignments to help you strengthen everything you learnt throughout the course.
Hurry! Enroll in this course and start your learning journey. Become a certified devOps engineer with pwskills.com.
Process in Operating systems FAQs
Q1. What is the process in operating system?
Ans: Process in operating system is an important part which is defined as a sequence of instructions executed in a predefined order. Any program that is executed in an operating system is termed as a process.
Q2. What is the lifecycle of process in an OS?
Ans: The lifecycle of a process consists of the following stages i,e. New, Ready, Running, Waiting and Termination States.
Q3. What is the use of Process in Operating system?
Ans: Process is basically used to execute a set of tasks in an operating system. It is a basic unit of work done in an operating system in executing different tasks.
Q4. What are some major components of Process in Operating system?
Ans: Some major components of process in operating system are Program, data, stack, heap and Process Control Block.