Practice
Solution
Step 1: Identify Banker's Algorithm assumptions
The algorithm requires prior knowledge of maximum resource needs for each process.Step 2: Analyze limitations
This requirement is often unrealistic in dynamic or unpredictable environments.Step 3: Evaluate other options
B is false; Banker's Algorithm handles multiple resource types.
C is false; it avoids deadlocks rather than causing them.
D is false; it does not preempt resources.Final Answer:
Option A -> Option AQuick Check:
Pre-declaration of max needs is the main practical limitation.
- Thinking it only supports one resource type
- Believing it causes deadlocks under load
- Confusing it with preemptive algorithms
Solution
Step 1: Analyze each statement
Imposing a strict ordering on resource acquisition always prevents deadlock is correct: ordering resources prevents circular wait; Allowing a philosopher to pick up both forks only if both are available prevents deadlock is correct: atomic acquisition avoids partial hold; Breaking one of the four Coffman conditions is sufficient to prevent deadlock is correct: breaking any Coffman condition prevents deadlock.Step 2: Evaluate Using asymmetric fork picking (odd philosophers pick left first, even pick right first) guarantees no starvation
Asymmetric fork picking prevents deadlock but does not guarantee no starvation, as some philosophers may be repeatedly delayed.Final Answer:
Option A -> Option AQuick Check:
Only Using asymmetric fork picking (odd philosophers pick left first, even pick right first) guarantees no starvation incorrectly claims starvation is guaranteed prevented.
- Assuming deadlock prevention implies starvation freedom
- Believing asymmetric picking solves all synchronization issues
- Confusing Coffman conditions with starvation conditions
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: Per-CPU context switch cost
Each CPU still saves/restores registers during context switches, so overhead per CPU is similar to single-core.Step 2: Additional multi-core factors
Multi-core systems require cache coherence protocols and synchronization mechanisms, adding overhead beyond single-core context switching.Step 3: Misconceptions
Context switching is not eliminated; CPUs do not save/restore registers twice per switch; scheduler speedup is not guaranteed.Final Answer:
Option A -> Option AQuick Check:
Multi-core adds complexity beyond per-CPU context switch overhead.
- Thinking multi-core removes context switch overhead
- Assuming overhead doubles incorrectly
- Believing scheduler is always faster on multi-core
Solution
Step 1: Understand why thrashing persists despite working set model
Even with working set allocation, total demand may exceed physical memory.Step 2: Analyze options
A is incorrect because increasing window size may increase working set size, worsening thrashing.
B is correct because load control reduces active processes, lowering total memory demand.
C is incorrect because disabling page replacement is not feasible and increases faults.
D is incorrect because fixed allocation ignores dynamic working sets, risking thrashing.Final Answer:
Option B -> Option BQuick Check:
Load control is the next step after working set model to prevent thrashing under overload.
- Thinking increasing working set window helps
- Believing disabling page replacement reduces faults
- Assuming fixed frame allocation solves thrashing
