Similar questions 2 more →
CPU Scheduling


Answer & solution
Answer: Shortest expected processing time first, subject to standard all-arrived nonpreemptive assumptions. (no official key was published)
Assume one processor, all four jobs ready at time zero, no scheduling overhead, and response interpreted as time to completion (or waiting time to first execution under nonpreemptive execution). Consider adjacent jobs of lengths a>b starting at time t. Their completion-time sum in order a,b is (t+a)+(t+a+b)=2t+2a+b. Reversing them gives 2t+2b+a, smaller by a−b. Other jobs' completion times do not change, because the pair's total length is unchanged. Repeatedly removing inversions proves ascending processing time is optimal.
Thus for x≥0: if x≤3, use x,3,5,6; if 3≤x≤5, use 3,x,5,6; if 5≤x≤6, use 3,5,x,6; if x≥6, use 3,5,6,x. Ties can be broken either way. For random run times the same exchange proof minimizes expected mean completion using their expected durations, when the decision is a fixed order and those expectations are known.
The answer is not a universal interactive-response policy: different release times, preemption or defining response as first service with arbitrarily small time slices changes the optimization problem. These are not specified, so the conventional nonpreemptive model is stated.