Practice
Solution
Step 1: Identify Peterson's algorithm characteristics
Peterson's algorithm uses busy waiting (spinlock), which can waste CPU resources.Step 2: Analyze other options
It cannot guarantee mutual exclusion under any circumstances is false because mutual exclusion is guaranteed. It depends on hardware atomic instructions to function correctly is incorrect since Peterson's algorithm was designed to avoid hardware atomic instructions. It allows unbounded waiting, leading to starvation is wrong because bounded waiting is guaranteed.Final Answer:
Option B -> Option BQuick Check:
Busy waiting is a known practical limitation of Peterson's algorithm.
- Assuming Peterson's needs hardware atomic instructions
- Confusing bounded waiting with starvation
- Believing mutual exclusion can fail
Solution
Step 1: Analyze each statement
A is correct; long processes delaying short ones is the convoy effect.
B is correct; preemption can reduce the convoy effect.
C is incorrect; the convoy effect increases average waiting time, not minimizes it.
D is correct; convoy effect can cause poor CPU utilization and longer waits.Step 2: Identify the incorrect statement
Only The convoy effect causes the average waiting time to always be minimal in FCFS falsely claims minimal average waiting time due to the convoy effect.Final Answer:
Option C -> Option CQuick Check:
Convoy effect worsens waiting time, not improves it.
- Assuming convoy effect improves waiting time
- Ignoring preemption as a mitigation
- Misunderstanding convoy effect impact on CPU utilization
Solution
Step 1: Understand C-SCAN fairness assumptions
C-SCAN assumes uniform head movement speed to provide uniform wait times.Step 2: Impact of variable head speed
Variable speed causes some requests to wait longer, breaking fairness and uniform wait time guarantees.Step 3: Mitigation strategies
Introducing a dynamic priority queue that accounts for estimated seek time can help balance servicing order and restore fairness.Step 4: Evaluate other options
Variable head speed does not affect C-SCAN fairness since it always services requests in one direction; no modification is needed. ignores the impact of speed variation; Variable head speed causes starvation in C-SCAN; switching to SSTF is the best mitigation. incorrectly claims starvation occurs and suggests SSTF, which can worsen starvation; Variable head speed improves average wait time by allowing faster servicing of distant requests; no modification is necessary. incorrectly claims variable speed improves wait times.Final Answer:
Option D -> Option DQuick Check:
Variable head speed breaks C-SCAN's uniform wait time guarantee; adding a dynamic priority queue based on estimated seek time can mitigate this. correctly identifies the problem and a plausible mitigation.
- Assuming C-SCAN fairness is speed-independent
- Confusing starvation with fairness degradation
- Believing variable speed always improves performance
Solution
Step 1: Understand cyclic reference pattern larger than frames
Pages are referenced in a cycle longer than available frames, causing repeated evictions.Step 2: Analyze LRU vs FIFO behavior
Both algorithms will evict pages that will be needed soon because the working set exceeds frame count.
LRU's advantage diminishes as no page stays long enough to be reused before eviction.Step 3: Evaluate options
LRU will have fewer page faults because it always evicts the least recently used page is false; LRU advantage is lost in cyclic patterns larger than frames.
LRU will perform optimally and minimize page faults in cyclic patterns is false; both have similar fault rates in this scenario.
LRU will have more page faults than FIFO because it keeps evicting pages that will be needed soon is false; LRU does not necessarily have more faults than FIFO here.
LRU and FIFO will have similar page fault rates due to cyclic references exceeding frame count is true; LRU and FIFO have similar fault rates due to cyclic references exceeding frame count.Final Answer:
Option D -> Option DQuick Check:
When working set > frames, LRU and FIFO fault rates converge.
- Assuming LRU always outperforms FIFO
- Believing cyclic patterns favor LRU
- Thinking LRU is optimal in all cases
Solution
Step 1: Understand quantum equal to longest burst
Setting quantum to longest burst means processes run mostly to completion without preemption.Step 2: Compare to FCFS
This behavior mimics FCFS, where processes run in arrival order without interruption.Step 3: Analyze fairness and turnaround
Fairness decreases because shorter processes wait longer, losing RR's time-sharing benefit. Turnaround time approaches FCFS values.Step 4: Evaluate incorrect options
Turnaround time decreases significantly and fairness improves due to fewer context switches is wrong because fewer context switches do not improve fairness. Fairness remains the same but turnaround time increases due to longer waiting times is wrong as fairness changes. Both turnaround time and fairness improve because processes get longer uninterrupted CPU bursts is wrong because fairness does not improve.Final Answer:
Option B -> Option BQuick Check:
Quantum = longest burst -> RR ≈ FCFS -> fairness ↓, turnaround ~ FCFS.
- Assuming fairness always improves with larger quantum
- Believing fewer context switches always reduce turnaround
- Ignoring that RR degenerates to FCFS with large quantum
