Consider a set of n tasks with known runtimes r₁, r₂, …, rₙ, all ready at time…
2007
Consider a set of n tasks with known runtimes r₁, r₂, …, rₙ, all ready at time 0 on a uniprocessor machine. If throughput is compared by the number of tasks completed by each intermediate time before the full batch finishes, which processor scheduling algorithm maximizes it?
Answer: B. Shortest job first — Concept — Throughput is the number of tasks completed per unit time. When all tasks are ready and their runtimes are known, arranging them in non-decreasing…
- A.
Round Robin
- B.
Shortest job first
- C.
Highest response ratio next
- D.
First come first served
Attempted by 337 students.
Show answer & explanation
Correct answer: B
Concept — Throughput is the number of tasks completed per unit time. When all tasks are ready and their runtimes are known, arranging them in non-decreasing runtime order minimizes every prefix completion time. Consequently, the maximum possible number of tasks has finished by each intermediate instant; the same ordering also minimizes average waiting and turnaround time.
Application — Sort the runtimes and execute each task to completion, from the smallest runtime to the largest.
For a concrete check, take runtimes 8, 5, and 2 time units.
Shortest-runtime order is 2, 5, 8, giving completion times 2, 7, and 15.
An arrival order of 8, 5, 2 gives completion times 8, 13, and 15. By time 7, the shortest-runtime order has completed two tasks, whereas that longer-first order has completed none.
The exchange argument generalizes this result: if a longer task precedes a shorter one, swapping the pair advances the shorter completion without delaying any later completion. Repeating the swap yields non-decreasing runtime order.
Selecting the smallest known runtime next is exactly the shortest-job-first rule.
Cross-check — The other rules optimize different criteria or ignore the known runtime ordering:
Round robin cycles through tasks by time quantum; unfinished tasks rejoin the queue, and context switches add overhead.
Highest response ratio next combines waiting time with service time to reduce starvation, so it may place a longer-waiting task ahead of a shorter task.
First come first served follows arrival order and can create a convoy when a long task precedes several short tasks.
Result: shortest job first gives the maximum throughput under the stated known-runtime, single-processor setting.