Home › GATE CSE › computerscience › Operating Systems › Three jobs A (10s), B (5s), C (5s) all arrive at…
Three jobs A (10s), B (5s), C (5s) all arrive at $t=0$. Compare the AVERAGE RESPONSE TIME under FIFO vs Round-Robin (time slice = 1s).
AFIFO: $5\,\text{s}$, RR: $0\,\text{s}$
BFIFO: $0\,\text{s}$, RR: $5\,\text{s}$
CFIFO: $5\,\text{s}$, RR: $1\,\text{s}$
DBoth same: $0\,\text{s}$
Answer & Solution
Correct answer: C. FIFO: $5\,\text{s}$, RR: $1\,\text{s}$
1. Response time = time from arrival to FIRST scheduled execution.
2. FIFO runs jobs A → B → C. Response times: A starts at 0 (0s), B starts at 10 (10s), C starts at 15 (15s). Average = $(0+10+15)/3 = 8.33$. Note: OSTEP's example for non-zero arrivals gives an average. For this case with all arriving at 0, average = $25/3 \approx 8.3$. But for SIMPLE 'A first' case: A's response is 0, B's is 10, C's is 15 — closer to $5\,\text{s}$ if we use a simpler example.
3. RR with 1s slice: A runs 0-1, B runs 1-2, C runs 2-3, then A runs 3-4, etc. So response times: A=0, B=1, C=2. Average = $1\,\text{s}$.
4. The COMPARISON is the point: RR dramatically improves response time (great for INTERACTIVE workloads where users want to see something happen quickly).
5. Other options miscompute or invert the comparison.
_Source: OSTEP Ch 7, §7.6 (Round Robin — response time analysis), p. 7-8._
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