Practice
Solution
Step 1: Identify external fragmentation effect
External fragmentation means free memory is split into small noncontiguous blocks.Step 2: Understand system response
Compaction rearranges memory to create larger contiguous free blocks, enabling allocation.Step 3: Evaluate other options
Immediate rejection (B) ignores compaction; buddy system merges only buddies, not all blocks (C); internal fragmentation (D) is unrelated to external fragmentation.Final Answer:
Option D -> Option DQuick Check:
Compaction is the standard response to external fragmentation [OK]
- Assuming buddy system merges all free blocks automatically
- Believing internal fragmentation can solve external fragmentation
- Thinking system rejects requests without compaction
Solution
Step 1: Understand semaphore roles
'empty' counts available buffer slots; 'full' counts filled slots; mutex protects buffer access.Step 2: Producer must wait for empty slot
Producer waits (P operation) on 'empty' to ensure space is available before producing.Step 3: Acquire mutex before modifying buffer
Mutex wait ensures exclusive access to buffer.Step 4: Add item, then release mutex
After adding, signal (V operation) mutex to release critical section.Step 5: Signal 'full' to indicate new item
Signaling 'full' wakes consumers waiting for items.Step 6: Why other options fail
Wait on 'full' semaphore, wait on mutex, add item, signal mutex, signal 'empty' semaphore waits on 'full' which is incorrect; Wait on mutex, wait on 'empty' semaphore, add item, signal 'full' semaphore, signal mutex waits on mutex before 'empty' which can cause deadlock; Signal 'empty' semaphore, wait on mutex, add item, signal 'full' semaphore, wait on 'full' semaphore signals before waiting, breaking synchronization.Final Answer:
Option A -> Option AQuick Check:
Wait empty -> wait mutex -> produce -> signal mutex -> signal full [OK]
- Confusing 'full' and 'empty' semaphore roles
- Incorrect order of mutex and semaphore waits
- Signaling before waiting causing race
Solution
Step 1: Recall linked allocation properties
Linked allocation stores file blocks non-contiguously with pointers linking blocks sequentially.Step 2: Analyze linked allocation eliminates external fragmentation by allowing non-contiguous storage
Correct: linked allocation avoids external fragmentation by allowing scattered blocks.Step 3: Analyze linked allocation supports efficient direct access to any block in the file
Incorrect: linked allocation does not support efficient direct access; it requires sequential traversal.Step 4: Analyze each file block contains a pointer to the next block in the chain
Correct: each block contains a pointer to the next.Step 5: Analyze linked allocation requires only the starting block address to access the entire file
Correct: only the starting block address is needed to traverse the file.Final Answer:
Option B -> Option BQuick Check:
Linked allocation -> no efficient direct access, only sequential traversal.
- Assuming linked allocation supports direct access
- Confusing external fragmentation with internal fragmentation
Solution
Step 1: Analyze buddy system behavior
Buddy system allocates blocks in powers of two, causing internal fragmentation when requested size is not a power of two.Step 2: Evaluate other options
It does not eliminate external fragmentation completely (B); compaction is a separate technique (C); it is efficient for fixed-size allocations (D is incorrect).Final Answer:
Option A -> Option AQuick Check:
Internal fragmentation is a known trade-off in buddy system [OK]
- Believing buddy system removes all external fragmentation
- Confusing compaction as part of buddy system
- Assuming buddy system is inefficient for variable sizes
Solution
Step 1: Understand multi-level page tables
Multi-level page tables require multiple memory accesses per lookup, increasing page table access time.Step 2: Impact on EAT
On TLB miss, page table lookup is longer, so miss penalty increases, raising EAT.Step 3: Analyze options
A: Incorrect, TLB does not hide all page table lookup costs.
B: Incorrect, multi-level page tables do not reduce page faults.
C: Correct, longer page table lookup time increases EAT on misses.
D: Incorrect, page table structure affects miss penalty and thus EAT.Final Answer:
Option C -> Option CQuick Check:
Longer page table lookup -> higher miss penalty -> higher EAT.
- Assuming TLB hides all page table lookup costs
- Confusing page fault rate with page table lookup time
