Different States of the Process : 5 Powerful Insights Every Beginner Must Know

0b63979cd9494aa401d1fce2d73bb002
On: October 5, 2025
Different States of the Process

Have you ever wondered how your computer runs so many applications at once — like playing music, browsing the web, and editing documents simultaneously?
Behind the scenes, the operating system (OS) manages multiple processes efficiently using something called the states of the process.

Understanding these states is one of the most important topics in operating systems, especially if you’re preparing for interviews or learning about how multitasking works.

A Real Moment — When My Laptop Froze but Taught Me Something

It was past midnight.
The room was quiet — just the soft hum of my old laptop breaking the silence.
I had my earphones plugged in, a cup of half-cold coffee beside me, and a half-written code file glowing on the screen.
The cursor blinked, waiting for my next line of logic.

And then, it happened — my laptop froze.

The music stopped.
My browser wouldn’t scroll.
Even the mouse refused to move.
For a second, I just sat there, staring at the screen — a tiny spinning circle replacing my patience.

I remember sighing and whispering, “Not again…”
I had a dozen things running — my compiler, a few tabs, a video tutorial, and a document. I thought my system had just given up on me.

But then, something clicked in my head.
It wasn’t that my laptop crashed — it was that it was busy managing everything at once.

Somewhere deep inside, my operating system was juggling — deciding which program to let run, which one to hold for a moment, and which one to end.
It wasn’t chaos.
It was control.
It was the states of the process silently doing their job.

At that moment, I realized — my computer wasn’t stuck; it was thinking.
It was managing processes like a traffic controller at a busy intersection — letting some pass, making others wait, and ensuring no two collided.

I leaned back and smiled. That “freeze” had just shown me what my textbook couldn’t.
It wasn’t just about programs and execution — it was about how life moves inside a machine.
Every process I launched — from opening a browser to running code — had its own little journey:
it was born (New), it waited its turn (Ready), it ran when chosen (Running), it paused when needed (Waiting), and finally, it completed its purpose (Terminated).

That night, I didn’t just learn about the states of the process
I saw them happen right in front of me.
The quiet hum of my laptop wasn’t noise anymore. It was rhythm —
a rhythm that told me every program has its own life cycle, its own flow, and its own ending.

From that moment, every time my laptop lags or my code pauses for a second,
I don’t get annoyed anymore — I smile.
Because I know what’s happening behind that pause.
My system is thinking.
My OS is working.
And the states of the process are quietly doing what they were designed to do — keeping everything in sync.

Introduction of process

What is a Process?

A process is simply a program in execution, representing the fundamental unit of work in an operating system. Whenever you open an application or run a command, the operating system creates a process to manage that task efficiently. Each process has its own memory space, CPU context, and process control block to store important details such as its state, process ID, and priority. To explore this topic in greater detail and understand how processes work along with their management structures, you can visit our in-depth guide on What is a Process and Process Table at Embedded Prep.

Each process has:

  • Its own memory space,
  • CPU time,
  • Registers, and
  • A Process Control Block (PCB) — which stores all the details about that process (like state, process ID, priority, etc.).

What Are the Different States of the Process?

In an operating system, a process doesn’t always stay in the same state. It keeps changing depending on what it’s doing.
Let’s look at the main states of the process one by one.

1. New (Creation State)

When a process is being created by the operating system, it is in the New state.
In this stage:

  • The OS allocates resources (memory, registers, etc.)
  • The process is waiting to be moved into the ready queue.

Example: When you double-click an app, the process first enters the New state before it can start running.

2. Ready State

Once the process is created, it moves to the Ready state.
Here, the process is loaded into the main memory and is waiting for the CPU to execute it.

  • The process is ready to run but hasn’t been given CPU time yet.
  • The OS scheduler decides which process will run next.

Example: Think of this like people waiting in a queue to use an ATM. Everyone is ready, but only one person can use it at a time.

3. Running State

When the CPU starts executing the process, it enters the Running state.
In this state:

  • The instructions of the process are being actively executed.
  • CPU registers and program counters are updated.

Example: When your computer is actually performing a task, like rendering a video or loading a webpage.

4. Waiting (Blocked) State

If the process needs to wait for some event to occur — like input/output (I/O) operations or resource availability — it enters the Waiting state.

  • The CPU stops executing this process temporarily.
  • Once the event is complete (like data is read from the disk), it moves back to the Ready state.

Example: A program waiting for user input or a file to load.

5. Terminated (Exit) State

Once the process finishes execution, it enters the Terminated state.
In this state:

  • All resources used by the process are released.
  • The PCB entry is deleted by the OS.

Example: When you close an app after finishing your work.

Process State Transition Diagram

A process keeps moving between these states depending on what’s happening:

New → Ready → Running → Waiting → Ready → Running → Terminated

This continuous switching helps the OS handle multitasking efficiently.

Why Are Process States Important?

Understanding the states of the process is crucial because:

  • It helps in designing schedulers and CPU management algorithms.
  • It ensures efficient CPU utilization.
  • It explains how multitasking and process synchronization work.

Coding Example of Process

C example demonstrates the different states of a Process

Save as process_states.c.

/*
 * process_states.c
 *
 * Simple demo program to illustrate the "states of the process"
 * (New, Ready, Running, Waiting, Terminated) using fork(), sleep(),
 * waitpid() and execvp().
 *
 * Compile:
 *   gcc -Wall -O2 -o process_states process_states.c
 *
 * Run:
 *   ./process_states
 *
 * Notes:
 * - This program prints messages in both parent and child showing
 *   when they reach each step. It simulates "Waiting" by using sleep()
 *   and shows an example of "Running" after execvp() replaces the child
 *   image (optional).
 *
 * Author: ChatGPT (example for learning purposes)
 */
#include 
#include 
#include 
#include 

int main(void) {
    pid_t pid;

    printf("Parent: creating a child process (New state for child)...\n");

    pid = fork(); /* Create child process */    if (pid < 0) {
        perror("fork failed");
        exit(EXIT_FAILURE);
    }

    if (pid == 0) {
        /* ----------------- Child process ----------------- */        /* At this point the child has been created (New) and will soon
         * be scheduled by the OS (Ready -> Running). We print messages
         * to demonstrate that. */        printf("Child (PID %d): I am created and ready to run (Ready state).\n", getpid());

        /* Simulate doing some CPU work (Running) */        printf("Child (PID %d): I'm running some CPU-bound work now (Running state)...\n", getpid());
        for (int i = 0; i < 3; ++i) {
            printf("Child (PID %d): working... %d/3\n", getpid(), i+1);
            sleep(1); /* small sleep to let you see output clearly */        }

        /* Simulate waiting for I/O or an event (Waiting/Blocked) */        printf("Child (PID %d): now waiting for I/O or an event (Waiting state) - sleeping 5s...\n", getpid());
        sleep(5); /* child is blocked/sleeping -> Waiting state */
        /* Optional: demonstrate exec (replaces process image) to show
         * another form of 'running' after loading a new program.
         * We'll exec "ls" with "-l" argument. Comment out if you don't want exec.
         */        char *argv[] = { "ls", "-l", NULL };
        printf("Child (PID %d): calling execvp() to replace my image with /bin/ls (still Running after exec)...\n", getpid());
        execvp("/bin/ls", argv);

        /* If execvp returns, it failed */        perror("execvp failed");
        _exit(EXIT_FAILURE);

    } else {
        /* ----------------- Parent process ----------------- */        printf("Parent (PID %d): child created with PID %d. Parent is running (Running state).\n", getpid(), pid);

        /* Parent can do other work while child runs or waits */        printf("Parent (PID %d): doing some work while child runs (simulate Ready/Running for parent)...\n", getpid());
        for (int i = 0; i < 2; ++i) {
            printf("Parent (PID %d): parent working... %d/2\n", getpid(), i+1);
            sleep(1);
        }

        /* Now parent will wait for the child to terminate.
         * When parent calls waitpid, parent may block until child exits.
         * This demonstrates synchronization and the child's Terminated state.
         */        printf("Parent (PID %d): waiting for child (PID %d) to terminate...\n", getpid(), pid);
        int status;
        pid_t w = waitpid(pid, &status, 0);
        if (w == -1) {
            perror("waitpid");
            exit(EXIT_FAILURE);
        }

        if (WIFEXITED(status)) {
            printf("Parent: child (PID %d) exited normally with status %d (Terminated state).\n", pid, WEXITSTATUS(status));
        } else if (WIFSIGNALED(status)) {
            printf("Parent: child (PID %d) was killed by signal %d.\n", pid, WTERMSIG(status));
        } else {
            printf("Parent: child (PID %d) ended with unknown status.\n", pid);
        }

        printf("Parent (PID %d): done. Parent will now exit.\n", getpid());
    }

    return 0;
}

What this program demonstrates (mapping to states of the process)

  • New: When the parent calls fork() a child is created — that moment corresponds to the New state for the child.
  • Ready: After creation the child becomes ready to run; the OS scheduler will move it to running when CPU time is given.
  • Running: When the child executes code (printing, loops) it is in Running.
  • Waiting (Blocked): When the child calls sleep(5), it is not using CPU — it is Waiting (blocked) for a timer; similarly real programs block during I/O.
  • Running after exec: execvp() replaces the child process image with another program (ls) — the process continues in the Running state but with a new program image.
  • Terminated: When the child program finishes, it becomes Terminated (exit), and the parent detects this with waitpid() and reads the exit status.

Compile & run (example)

gcc -Wall -O2 -o process_states process_states.c
./process_states

Example output (truncated, order may vary due to scheduling)

Parent: creating a child process (New state for child)...
Parent (PID 12345): child created with PID 12346. Parent is running (Running state).
Parent (PID 12345): doing some work while child runs (simulate Ready/Running for parent)...
Child (PID 12346): I am created and ready to run (Ready state).
Child (PID 12346): I'm running some CPU-bound work now (Running state)...
Child (PID 12346): working... 1/3
Parent (PID 12345): parent working... 1/2
Child (PID 12346): working... 2/3
Parent (PID 12345): parent working... 2/2
Child (PID 12346): working... 3/3
Child (PID 12346): now waiting for I/O or an event (Waiting state) - sleeping 5s...
Parent (PID 12345): waiting for child (PID 12346) to terminate...
Child (PID 12346): calling execvp() to replace my image with /bin/ls (still Running after exec)...
... output of `ls -l` ...
Parent: child (PID 12346) exited normally with status 0 (Terminated state).
Parent (PID 12345): done. Parent will now exit.

Advantages, Disadvantages, and Applications of the States of the Process in Operating System

In our previous section, we learned what are the different states of the process — such as New, Ready, Running, Waiting, and Terminated.
Now, let’s understand why these states exist, what benefits they offer, what challenges they bring, and where they are used in real life.

Advantages of the States of the Process

The states of the process form the foundation of how an operating system handles multitasking and process management.
Here are the key advantages:

1. Efficient CPU Utilization

By managing each process through different states, the OS ensures that the CPU never remains idle.
When one process is waiting (e.g., for I/O), the OS schedules another ready process, improving performance.

2. Better Multitasking

Process states help the OS handle multiple processes at the same time.
While one process executes, others can stay in the Ready or Waiting state, ensuring smooth multitasking.

3. Improved Resource Management

Every process gets memory, CPU, and I/O resources based on its state.
This prevents one process from blocking all system resources.

4. Easy Debugging and Monitoring

Using process states, system administrators can monitor process behavior.
For example, if a process is stuck in the Waiting state for too long, it indicates an I/O bottleneck.

5. Supports Process Scheduling

Schedulers rely on the states of the process to decide which process should run next, ensuring fair distribution of CPU time.

Disadvantages of the States of the Process

While process states improve control and organization, they also bring certain limitations:

1. Increased Overhead

Managing multiple states requires extra CPU cycles and memory to maintain the Process Control Block (PCB) and state transitions.

2. Complexity in Scheduling

The process lifecycle adds complexity to process scheduling algorithms (like Round Robin, FCFS, etc.), which need to handle multiple queues.

3. Context Switching Delay

Frequent switching between Ready and Running states causes context switching overhead, which slightly reduces system efficiency.

4. Difficult Synchronization

When multiple processes share resources, handling synchronization between Waiting and Running states becomes challenging.

5. Debugging Concurrency Issues

Because processes change states asynchronously, detecting deadlocks, race conditions, or starvation becomes difficult.

Applications of the States of the Process

The concept of process states is not just theoretical — it’s used everywhere in modern computing systems.
Here are some practical applications:

1. Operating System Design

Every modern OS — such as Linux, Windows, macOS, or QNX — uses process states to manage execution and multitasking.

2. Real-Time Systems

In embedded and automotive systems, process states help prioritize critical tasks (like sensor data processing or control algorithms) efficiently.

3. Cloud Computing and Virtualization

Cloud servers handle thousands of processes.
States of the process help allocate CPU time fairly among virtual machines and applications.

4. Mobile Operating Systems

Android and iOS use process states to suspend inactive apps (Waiting state) and resume them quickly when needed, saving power and resources.

5. Performance Monitoring Tools

Tools like top, htop, or Task Manager rely on process states to display running, sleeping, or zombie processes.

Quick Recap of Process States

StateDescription
NewProcess is being created
ReadyProcess is ready to run but waiting for CPU
RunningProcess is being executed by CPU
WaitingProcess is waiting for an event or resource
TerminatedProcess has completed execution

Final Thought

The different states of the process form the foundation of how an operating system works internally.
From creation to termination, every process goes through these stages to ensure smooth multitasking and resource management.

If you’re preparing for interviews, remember to explain not just the names but also the transitions between states — it shows deeper understanding.

FAQ : Different States of the Process

1. What are the different states of the process in operating systems?

The different states of the process in an operating system include New, Ready, Running, Waiting (Blocked), and Terminated. These states represent the life cycle of a process from creation to completion, enabling efficient process management and CPU scheduling.

2. Why are states of the process important?

States of the process are important because they allow the operating system to organize and manage processes efficiently. They help in multitasking, resource allocation, and maintaining system stability by ensuring each process gets appropriate CPU time and resources.

3. What happens in the Ready state of a process?

In the Ready state, the process is loaded into main memory and waiting for CPU time. It is ready to execute but must wait for the operating system’s scheduler to assign CPU resources.

4. How does the Waiting state work in a process lifecycle?

The Waiting state (also called Blocked state) occurs when a process cannot proceed until an event is completed — such as an I/O operation or resource availability. The process moves back to the Ready state once the event is resolved.

5. Can a process move directly from New to Running state?

No, a process cannot directly move from the New state to the Running state. It first moves to the Ready state, where it waits for CPU scheduling before execution begins.

6. What is the Terminated state of a process?

The Terminated state occurs when a process finishes its execution. At this point, all resources allocated to the process are released, and the process control block is deleted by the operating system.

7. How does understanding states of the process help in process management?

Understanding the states of the process helps developers and system administrators optimize CPU scheduling, improve multitasking, and design efficient operating systems. It is essential for creating stable and high-performance systems.

8. Where can I learn more about process lifecycle and process table?

You can read a detailed beginner-friendly guide on What is a Process and Process Table at Embedded Prep to deepen your understanding of process states and lifecycle management.

Leave a Comment