0
0
Operating Systemsknowledge~6 mins

Scheduling criteria (turnaround time, waiting time, throughput) in Operating Systems - Full Explanation

Choose your learning style9 modes available
Introduction
Imagine you have many tasks to do, but only one person to do them. How do you decide which task to do first so that everything finishes quickly and fairly? Scheduling criteria help us measure how well we manage these tasks in a computer system.
Explanation
Turnaround Time
Turnaround time is the total time taken from when a task arrives until it is fully completed. It includes the time the task waits and the time it actually runs. This helps us understand how long a user waits to get their job done.
Turnaround time measures the full duration a task spends in the system from start to finish.
Waiting Time
Waiting time is the total time a task spends waiting in the queue before it gets the chance to run. It does not include the running time. This shows how long a task is delayed before execution.
Waiting time focuses only on the delay before a task starts running.
Throughput
Throughput is the number of tasks completed in a given amount of time. Higher throughput means more tasks are finished quickly. It helps measure the efficiency of the system in handling many tasks.
Throughput measures how many tasks the system completes over time.
Real World Analogy

Imagine a busy coffee shop with many customers placing orders. Turnaround time is how long each customer waits from ordering to receiving their coffee. Waiting time is how long they stand in line before their order is taken. Throughput is how many customers get served in an hour.

Turnaround Time → Total time a customer spends from ordering to getting their coffee
Waiting Time → Time a customer waits in line before placing their order
Throughput → Number of customers served in one hour
Diagram
Diagram
┌───────────────┐
│   Task Arrives│
└──────┬────────┘
       │
       ▼
┌───────────────┐
│  Waiting Time │
│ (in queue)    │
└──────┬────────┘
       │
       ▼
┌───────────────┐
│  Running Time │
│ (execution)   │
└──────┬────────┘
       │
       ▼
┌───────────────┐
│Turnaround Time│
│(Waiting + Run)│
└───────────────┘

Throughput: Number of tasks completed per unit time → ↑
This diagram shows the flow of a task through waiting and running stages, illustrating turnaround time and waiting time, with throughput as tasks completed over time.
Key Facts
Turnaround TimeTotal time from task arrival to completion including waiting and running.
Waiting TimeTotal time a task spends waiting in the queue before execution.
ThroughputNumber of tasks completed per unit time.
Common Confusions
Thinking turnaround time and waiting time are the same.
Thinking turnaround time and waiting time are the same. Turnaround time includes both waiting and running time, while waiting time only counts the delay before running.
Assuming higher throughput always means shorter waiting time.
Assuming higher throughput always means shorter waiting time. High throughput means more tasks finish over time, but some tasks may still wait longer depending on scheduling.
Summary
Turnaround time measures the full duration a task spends in the system from arrival to completion.
Waiting time counts only the delay before a task starts running, excluding execution time.
Throughput shows how many tasks the system completes in a given time, indicating efficiency.