Practice
Solution
Step 1: Understand contiguous allocation characteristics
Contiguous allocation stores all file blocks sequentially on disk, enabling fast sequential and direct access without extra pointers.Step 2: Analyze when fast sequential and direct access to file blocks is required with minimal overhead
Fast sequential and direct access is exactly what contiguous allocation optimizes for.Step 3: Analyze when files are frequently extended or shrunk dynamically during runtime
Contiguous allocation struggles with dynamic file size changes due to fragmentation and need for contiguous free space.Step 4: Analyze when the file system must handle very large files with unpredictable sizes
Large unpredictable files are better handled by linked or indexed allocation to avoid fragmentation and allocation overhead.Step 5: Analyze when minimizing external fragmentation is the highest priority
Contiguous allocation tends to cause external fragmentation, so it does not minimize it.Final Answer:
Option C -> Option CQuick Check:
Contiguous allocation -> fast access but poor flexibility and fragmentation handling.
- Assuming contiguous allocation handles dynamic file sizes well
- Confusing fragmentation minimization with contiguous allocation benefits
Solution
Step 1: Identify starvation characteristics
Starvation happens when a process is perpetually denied access to resources due to scheduling policies favoring others, typically higher-priority processes.Step 2: Analyze each option
A low-priority process never gets CPU time because higher-priority processes keep running correctly describes starvation as a low-priority process being indefinitely postponed. Two or more processes wait indefinitely for each other to release resources describes deadlock, where processes wait on each other. Processes continuously change states without making progress due to resource contention describes livelock, where processes are active but not progressing. A process is blocked waiting for I/O to complete is normal blocking, not starvation.Final Answer:
Option B -> Option BQuick Check:
Starvation involves indefinite postponement due to priority, matching a low-priority process never getting CPU time because higher-priority processes keep running.
- Confusing starvation with deadlock
- Thinking livelock is the same as starvation
Solution
Step 1: Evaluate each statement
A is correct because FCFS can cause long waiting times for short processes due to the convoy effect.
B is incorrect because FCFS does not guarantee the shortest average waiting time; algorithms like SJF do.
C is incorrect because FCFS is non-preemptive and does not allow preemption.
D is incorrect because FCFS scheduling complexity is O(n), simple queue processing.Step 2: Identify the limitation
The convoy effect causing long waiting times for short processes is a key limitation.Final Answer:
Option A -> Option AQuick Check:
FCFS is simple but can cause poor responsiveness due to the convoy effect.
- Believing FCFS minimizes average waiting time
- Confusing FCFS with preemptive algorithms
- Overestimating FCFS scheduling complexity
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: 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
