Home › GATE CSE › computerscience › Operating Systems › The SHORTEST JOB FIRST (SJF) scheduler addresses…
The SHORTEST JOB FIRST (SJF) scheduler addresses the convoy effect by
Arunning the longest remaining job first
Bround-robining with a 1-tick quantum
Cpreempting at every clock interrupt
Drunning the shortest available job first
Answer & Solution
Correct answer: D. running the shortest available job first
1. OSTEP §7.4 introduces SJF: of all jobs that have arrived, run the one with the smallest run time first; non-preemptive.
2. SJF is PROVABLY OPTIMAL for minimising average turnaround when all jobs arrive at the same time.
3. Example: jobs (A,B,C) = (100,10,10) arriving at t=0. SJF runs B (10), C (20), A (120). Average = (10+20+120)/3 = 50, much better than FIFO's 110.
4. Option A is the opposite (worst-case scheduling). Option B is round-robin. Option D is timer-driven preemption (RR-style), not SJF.
_Source: OSTEP Ch 7, §7.4 (Shortest Job First), p. 4-5._
Related questions
On a MULTI-CORE system, a SPIN LOCK is generallyDisabling INTERRUPTS as a way to implement mutual exclusion on a single-CPU system isA LIVELOCK differs from a DEADLOCK in thatSuppose thread A acquires lock L1, then thread B acquires lock L2. Now A tries to acquire Without atomic hardware support, building a correct mutual-exclusion lock for $N \geq 2$ tA CRITICAL SECTION isLinux's `pthread_mutex_lock()` is typically implemented as a HYBRID:What is the PRIMARY problem with using a SPIN LOCK on a SINGLE-CPU uniprocessor system (wi