Home › GATE CSE › computerscience › Operating Systems › When jobs arrive at DIFFERENT times, non-preempt…
When jobs arrive at DIFFERENT times, non-preemptive SJF can still suffer from a long job running before a short one arrives. The PREEMPTIVE version that addresses this is
AFIFO with priority
BShortest Time-to-Completion First (STCF)
CRound-Robin with priority boost
DMulti-Level Feedback Queue (MLFQ)
Answer & Solution
Correct answer: B. Shortest Time-to-Completion First (STCF)
1. OSTEP §7.5 introduces STCF: every time a NEW job arrives, the scheduler checks if its remaining time is less than the currently-running job's remaining time. If so, it PREEMPTS and runs the new (shorter) job.
2. STCF is also called Preemptive Shortest Job First (PSJF) or Shortest Remaining Time to Completion First.
3. STCF is PROVABLY OPTIMAL for minimising average turnaround in the general case (variable arrival times) — assuming you know job lengths.
4. Option A is wrong policy. Option C describes MLFQ. Option D is a different multi-queue strategy.
_Source: OSTEP Ch 7, §7.5 (Shortest Time-to-Completion First), p. 5-6._
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