Operating Systems & Administration

[Day 2] 5. Process Life Cycle

D
DITISS Admin
••3 min read

!5. Process Life Cycle.png

The 5-state process model is commonly used in operating systems to describe the various states a process can be in during its life-cycle. Here’s a breakdown of the states:

  1. New:

    • The process is being created.
    • Resources are allocated to it, but it is not yet ready for execution.
    • Example: When you start a program, the operating system prepares the process by allocating memory and other resources.
  2. Ready:

    • The process has been created and is waiting to be assigned to a CPU for execution.
    • It’s ready to run, but not currently executing because the CPU is occupied with another process.
    • Multiple processes may be in this state, waiting their turn for CPU time.
  3. Running:

    • The process is actively being executed by the CPU.
    • Only one process can be in this state on a single-core system (multiple processes can run simultaneously in a multi-core system).
    • The process is performing the tasks for which it was designed.
  4. Blocked/Waiting:

    • The process cannot continue execution until some event occurs, such as the completion of an I/O operation.
    • It is not ready for execution and is waiting for some external event to happen.
    • Example: If a process is reading data from a file, it might be blocked until the data becomes available.
  5. Terminated:

    • The process has finished execution.
    • It may have completed its task or terminated due to some error.
    • All resources associated with the process are released back to the system.

Transition between States:

  • New → Ready: After creation, the process moves to the ready queue.
  • Ready → Running: The scheduler picks the process from the ready queue for execution.
  • Running → Ready: The process is preempted (paused) by the scheduler and moved back to the ready queue if its time slice ends or a higher-priority process needs to run.
  • Running → Blocked: The process moves to the blocked state if it needs to wait for an event (like I/O).
  • Blocked → Ready: Once the event is completed (e.g., I/O operation finishes), the process returns to the ready queue.
  • Running → Terminated: The process completes its execution and is terminated.

This 5-state model helps in understanding how processes move through different phases as they execute in a computer system.

Notes:

CPU Scheduler: A CPU scheduler is part of the operating system that determines which process in the ready queue gets to use the CPU next. It manages process execution to optimise CPU utilisation, response time, and overall system performance, employing various scheduling algorithms like First-Come, First-Served (FCFS), Round Robin (RR), and Shortest Job Next (SJN).

Read Next

8/26/2026

[Day 2] 6. Some more commands

### File Manipulation Commands #### Displaying File Content 1. **Number Lines**: `cat -n <filename>` - Displays the contents of the fi...

8/26/2026

[Day 2] 7. Redirection

### Console Standard Files The console operates with three internal standard files: 1. **Standard Input File**: Used to take input. 2. **Standa...