Practice
Solution
Step 1: Understand preemptive SJF behavior
Preemptive SJF allows the CPU to switch to a newly arrived process if it has a shorter burst time than the currently running process.Step 2: Analyze scenarios
If new processes with shorter burst times can arrive anytime, preemptive SJF ensures the CPU always runs the shortest job next, improving average waiting time.Step 3: Why other options are incorrect
A: If all processes arrive simultaneously with similar burst times, preemptive advantage is minimal.
B: Starvation is a concern in preemptive SJF, so it's not chosen when fairness is ignored.
C: Preemptive SJF increases context switches, so it's not preferred when minimizing overhead.Final Answer:
Option A -> Option AQuick Check:
Preemptive SJF is best when shorter jobs can arrive anytime, requiring immediate preemption.
- Assuming preemptive SJF always reduces overhead
- Believing preemptive SJF is best when all jobs arrive simultaneously
Solution
Step 1: Understand deadlock conditions
Deadlock occurs when each process holds a resource and waits for the other, causing indefinite blocking.Step 2: Analyze the immediate aftermath
Neither process releases resources voluntarily, so both remain blocked indefinitely (both processes remain blocked indefinitely, waiting for the other to release the resource). Both processes releasing their held resources and retrying immediately is incorrect because processes do not release resources spontaneously. The operating system preempting one process to break the deadlock automatically is incorrect as OS preemption is not automatic in typical deadlock. Both processes entering a livelock, continuously retrying without progress describes livelock, which involves active state changes, not blocking.Final Answer:
Option A -> Option AQuick Check:
Deadlock means indefinite waiting without resource release, matching both processes remain blocked indefinitely, waiting for the other to release the resource.
- Assuming OS automatically resolves deadlock
- Confusing deadlock with livelock
Solution
Step 1: Understand FIFO Eviction Policy
FIFO evicts the oldest loaded page, not the least recently used.Step 2: Evaluate Each Option
FIFO can suffer from Belady's anomaly where increasing frames increases page faults is correct; Belady's anomaly can occur with FIFO.
FIFO always evicts the least recently used page is incorrect; FIFO does not track recency of use.
FIFO is simple to implement with a queue data structure is correct; FIFO uses a queue for eviction order.
FIFO does not consider how frequently or recently a page was accessed is correct; FIFO ignores frequency and recency.Final Answer:
Option A -> Option AQuick Check:
FIFO evicts by arrival order, not usage recency.
- Confusing FIFO with LRU eviction criteria
- Assuming FIFO tracks page usage
- Believing FIFO cannot have anomalies
Solution
Step 1: Recall EAT formula
EAT = (hit ratio x access time on hit) + (miss ratio x access time on miss)Step 2: Analyze each statement
A: Correct, EAT depends on hit ratio and memory times.
B: Incorrect, TLB miss does not always cause page fault; it triggers page table lookup.
C: Correct, formula reflects hit and miss costs.
D: Correct, higher hit ratio lowers average access time.Final Answer:
Option A -> Option AQuick Check:
TLB miss ≠ page fault; page fault only if page not in memory.
- Confusing TLB miss with page fault
- Misapplying EAT formula
Solution
Step 1: Identify internal fragmentation cause
Buddy system rounds allocations to power-of-two sizes, causing internal fragmentation.Step 2: Evaluate strategies
Slab allocator efficiently manages fixed-size objects, reducing internal fragmentation without slowing allocation.Step 3: Analyze other options
Increasing minimum block size (A) increases internal fragmentation; compaction (C) addresses external fragmentation; fixed partitioning (D) is inflexible and can worsen fragmentation.Final Answer:
Option C -> Option CQuick Check:
Slab allocators complement buddy system to reduce internal fragmentation [OK]
- Thinking compaction reduces internal fragmentation
- Assuming bigger minimum block size reduces fragmentation
- Believing fixed partitioning eliminates fragmentation
