CPU Scheduling Criteria in OS

CPU Scheduling Criteria are the standards used to measure how well a CPU scheduling algorithm performs in an operating system. They help determine how efficiently the CPU is assigned to processes and how effectively the system executes them. A good scheduling algorithm should maximize CPU utilization and throughput while minimizing waiting time, turnaround time, and response time.

CPU Scheduling Criteria in OS

The main goal of CPU scheduling criteria is to use the CPU effectively, complete more processes in less time, and reduce the waiting and response time of processes.

Why is CPU Scheduling Criteria Important?

CPU scheduling criteria help improve the overall performance of an operating system. Their importance is listed below.

  • Measures Scheduling Performance: It evaluates how efficiently a scheduling algorithm allocates the CPU to processes.
  • Improves CPU Utilization: Proper scheduling keeps the CPU busy and reduces idle time.
  • Increases System Throughput: More processes can complete within a given period.
  • Reduces Process Delays: It minimizes waiting, turnaround, and response times.
  • Supports Fair Process Execution: Every process gets a fair opportunity to use the CPU.

Types of CPU Scheduling Criteria

The operating system uses the following criteria to evaluate CPU scheduling algorithms.

1. CPU Utilization

CPU Utilization is the percentage of time the CPU remains busy executing processes instead of staying idle.

Formula

  • CPU Utilization = (CPU Busy Time / Total Time) × 100%

Goal

  • Maximize CPU utilization.

Example

  • If the CPU is busy for 95 seconds out of 100 seconds, then: CPU Utilization = (95 / 100) × 100 = 95%

2. Throughput

Throughput is the number of processes completed by the CPU in a given amount of time.

Formula

  • Throughput = Number of Completed Processes / Total Time

Goal

  • Maximize throughput.

Example

  • If the CPU completes 80 processes in 20 seconds, then: Throughput = 4 processes per second

3. Turnaround Time (TAT)

Turnaround Time is the total time taken by a process from its arrival in the ready queue until its execution is completed.

Formula

  • Turnaround Time = Completion Time − Arrival Time

Goal

  • Minimize turnaround time.

Example

  • Whn Arrival Time = 2 ms, Completion Time = 15 ms then;  Turnaround Time = 15 − 2 = 13 ms

4. Waiting Time (WT)

Waiting Time is the total time a process spends waiting in the ready queue before it gets the CPU.

Formula

Waiting Time = Turnaround Time − CPU Burst Time

Goal

  • Minimize waiting time.

Example

  • When Turnaround Time = 15 ms, CPU Burst Time = 6 ms then Waiting Time = 15 − 6 = 9 ms

5. Response Time (RT)

Response Time is the time between the arrival of a process and the first time it receives the CPU.

Formula

Response Time = First CPU Start Time − Arrival Time

Goal

  • Minimize response time.

Example

  • When Arrival Time = 4 ms, First CPU Start Time = 7 ms then Response Time = 7 − 4 = 3 ms

Real-Life Example

Imagine a supermarket with one billing counter.

  • CPU Utilization: The cashier remains busy serving customers instead of sitting idle.
  • Throughput: The number of customers served per hour.
  • Turnaround Time: The total time from when a customer joins the queue until billing is completed.
  • Waiting Time: The time a customer spends waiting in the queue before reaching the cashier.
  • Response Time: The time from entering the queue until the cashier starts serving the customer.

Advantages of Using CPU Scheduling Criteria

CPU scheduling criteria help evaluate and improve the performance of scheduling algorithms. Their major advantages are listed below.

  • Improves CPU Performance: Helps select algorithms that keep the CPU busy and reduce idle time.
  • Enhances System Efficiency: Optimizes process execution and overall operating system performance.
  • Reduces Process Delays: Minimizes waiting, turnaround, and response times.
  • Supports Fair Scheduling: Ensures CPU time is distributed fairly among processes.
  • Helps Compare Scheduling Algorithms: Makes it easier to evaluate algorithms based on measurable performance metrics.

Conclusion

CPU Scheduling Criteria in Operating System (OS) are the key performance measures used to evaluate the efficiency of CPU scheduling algorithms. By maximizing CPU utilization and throughput while minimizing turnaround time, waiting time, and response time, the operating system can improve process execution and overall system performance. Understanding these criteria is essential for analyzing and comparing different CPU scheduling algorithms in operating systems.