Bird
Raised Fist0
Operating Systemsknowledge~10 mins

Scheduling criteria (turnaround time, waiting time, throughput) in Operating Systems - Step-by-Step Execution

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Concept Flow - Scheduling criteria (turnaround time, waiting time, throughput)
Start: Processes arrive
Schedule processes
Calculate Turnaround Time
Calculate Waiting Time
Calculate Throughput
Evaluate performance
Processes arrive and are scheduled; then turnaround time, waiting time, and throughput are calculated to evaluate scheduling performance.
Execution Sample
Operating Systems
Process | Arrival | Burst
P1      | 0       | 4
P2      | 1       | 3
P3      | 2       | 1

Calculate turnaround, waiting, throughput
This example schedules three processes and calculates their turnaround time, waiting time, and throughput.
Analysis Table
StepProcessStart TimeFinish TimeTurnaround TimeWaiting TimeThroughput (Processes Completed)
1P1044 - 0 = 40 - 0 = 01
2P2477 - 1 = 64 - 1 = 32
3P3788 - 2 = 67 - 2 = 53
4-----Throughput = 3 processes / 8 time units = 0.375
💡 All processes completed by time 8; throughput calculated as total processes divided by total time.
State Tracker
VariableStartAfter P1After P2After P3Final
Start Time-047-
Finish Time-478-
Turnaround Time-466-
Waiting Time-035-
Throughput01230.375
Key Insights - 3 Insights
Why is waiting time different from turnaround time?
Waiting time is the time a process waits before execution (see rows 1-3 in execution_table), while turnaround time includes both waiting and execution time.
How is throughput calculated?
Throughput is total processes completed divided by total time taken (see step 4 in execution_table).
Why does process P3 have a longer waiting time despite a short burst time?
Because P3 arrives later and waits for P1 and P2 to finish (see waiting time values in execution_table).
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table at step 2: What is the waiting time for process P2?
A4
B1
C3
D0
💡 Hint
Check the Waiting Time column for P2 in execution_table row 2.
At which step does the throughput reach 3 processes completed?
AStep 1
BStep 3
CStep 4
DStep 2
💡 Hint
Look at the Throughput column in execution_table rows.
If process P3 arrived at time 0 instead of 2, how would its waiting time change?
AIt would decrease
BIt would increase
CIt would stay the same
DIt would be zero
💡 Hint
Refer to variable_tracker Waiting Time values and consider arrival times.
Concept Snapshot
Scheduling criteria:
- Turnaround Time = Finish Time - Arrival Time
- Waiting Time = Turnaround Time - Burst Time
- Throughput = Number of processes completed / Total time
These metrics help evaluate how well a scheduler performs.
Full Transcript
Scheduling criteria measure how well an operating system schedules processes. Turnaround time is the total time from process arrival to completion. Waiting time is how long a process waits before it starts running. Throughput is how many processes finish per unit time. In the example, three processes arrive at different times and run one after another. We calculate each process's turnaround and waiting times and then compute throughput as total processes divided by total time. These values help us understand the efficiency of scheduling.

Practice

(1/5)
1. Which scheduling criterion measures the total time taken from the arrival of a process to its completion?
easy
A. Turnaround time
B. Waiting time
C. Throughput
D. Response time

Solution

  1. Step 1: Understand the definition of turnaround time

    Turnaround time is the total time from when a process arrives until it finishes execution.
  2. Step 2: Compare with other criteria

    Waiting time is only the time a process waits before starting, throughput is number of processes completed per time, and response time is time until first response.
  3. Final Answer:

    Turnaround time -> Option A
  4. Quick Check:

    Turnaround time = total process duration [OK]
Hint: Turnaround = arrival to finish total time [OK]
Common Mistakes:
  • Confusing waiting time with turnaround time
  • Mixing throughput with time durations
  • Thinking response time equals turnaround time
2. Which of the following correctly defines waiting time in process scheduling?
easy
A. Number of processes completed per unit time
B. Time from process arrival to completion
C. Time a process spends in the ready queue before execution
D. Time taken by CPU to execute the process

Solution

  1. Step 1: Define waiting time

    Waiting time is the time a process spends waiting in the ready queue before it starts running on the CPU.
  2. Step 2: Eliminate other options

    Time from process arrival to completion describes turnaround time, C describes throughput, and D is CPU burst time, not waiting time.
  3. Final Answer:

    Time a process spends in the ready queue before execution -> Option C
  4. Quick Check:

    Waiting time = time before execution [OK]
Hint: Waiting time = time before process runs [OK]
Common Mistakes:
  • Confusing waiting time with turnaround time
  • Thinking waiting time includes execution time
  • Mixing throughput with waiting time
3. Consider three processes with the following completion times (in seconds): P1=10, P2=15, P3=20. If all arrived at time 0, what is the throughput if the total time observed is 20 seconds?
medium
A. 0.20 processes per second
B. 0.15 processes per second
C. 0.10 processes per second
D. 0.25 processes per second

Solution

  1. Step 1: Calculate total processes completed

    All three processes (P1, P2, P3) completed within 20 seconds, so total completed = 3.
  2. Step 2: Calculate throughput

    Throughput = number of processes completed / total time = 3 / 20 = 0.15 processes per second.
  3. Final Answer:

    0.15 processes per second -> Option B
  4. Quick Check:

    Throughput = 3/20 = 0.15 [OK]
Hint: Throughput = completed tasks ÷ total time [OK]
Common Mistakes:
  • Dividing total time by number of processes instead of reverse
  • Counting incomplete processes
  • Using average completion time instead of total time
4. A scheduler reports the following for a process: Arrival time = 0, Start time = 5, Completion time = 12. The waiting time is incorrectly calculated as 7 seconds. What is the correct waiting time?
medium
A. 5 seconds
B. 7 seconds
C. 12 seconds
D. 0 seconds

Solution

  1. Step 1: Understand waiting time formula

    Waiting time = Start time - Arrival time = 5 - 0 = 5 seconds.
  2. Step 2: Identify error in reported waiting time

    The reported waiting time of 7 seconds is incorrect because it does not match the formula.
  3. Final Answer:

    5 seconds -> Option A
  4. Quick Check:

    Waiting time = start - arrival = 5 [OK]
Hint: Waiting time = start time minus arrival time [OK]
Common Mistakes:
  • Using completion time instead of start time
  • Adding instead of subtracting times
  • Confusing waiting time with turnaround time
5. A system runs 4 processes with arrival times and burst times as follows:
P1: arrival=0, burst=4
P2: arrival=1, burst=3
P3: arrival=2, burst=1
P4: arrival=3, burst=3
If the scheduler uses First-Come-First-Serve (FCFS), what is the average turnaround time?
hard
A. 3.5 seconds
B. 4.5 seconds
C. 5.0 seconds
D. 6.0 seconds

Solution

  1. Step 1: Calculate completion times using FCFS

    Process order by arrival: P1(0), P2(1), P3(2), P4(3).
    P1 completes at 0+4=4,
    P2 starts at 4, completes at 4+3=7,
    P3 starts at 7, completes at 7+1=8,
    P4 starts at 8, completes at 8+3=11.
  2. Step 2: Calculate turnaround times

    Turnaround = completion - arrival:
    P1: 4-0=4,
    P2: 7-1=6,
    P3: 8-2=6,
    P4: 11-3=8.
    Average turnaround = (4+6+6+8)/4 = 24/4 = 6.0 seconds.
  3. Final Answer:

    6.0 seconds -> Option D
  4. Quick Check:

    Average turnaround = 24/4 = 6.0 [OK]
Hint: Turnaround = completion - arrival; average = sum/number [OK]
Common Mistakes:
  • Calculating turnaround as burst time only
  • Ignoring arrival times in scheduling order
  • Mixing waiting time with turnaround time