Practice
Solution
Step 1: Understand Optimal Algorithm's Principle
The Optimal algorithm evicts the page that will not be used for the longest time in the future, which requires knowledge of future requests.Step 2: Analyze Each Option
When the system can predict future page requests accurately is correct because Optimal needs future knowledge to be effective.
When the system has very limited memory and needs a simple algorithm is incorrect because Optimal is complex and not simple.
When the workload is highly random and unpredictable is incorrect because unpredictability makes future knowledge impossible.
When the system wants to minimize implementation complexity is incorrect because Optimal is the most complex to implement.Final Answer:
Option C -> Option CQuick Check:
Optimal is theoretical and best when future requests are known.
- Assuming Optimal is practical without future knowledge
- Confusing simplicity with effectiveness
- Believing Optimal works well with random workloads
Solution
Step 1: At time 0
Only P1 has arrived, so P1 starts running.Step 2: At time 1
P2 arrives with burst 4, which is less than P1's remaining 7, so preemption occurs and P2 runs.Step 3: At time 2
P3 arrives with burst 2, less than P2's remaining 3, so preemption occurs and P3 runs.Step 4: At time 3
P3 has run 1 unit (remaining 1), P2 and P1 are waiting. Since P3 has the shortest remaining time, it continues running.Final Answer:
Option C -> Option CQuick Check:
At time 3, the shortest remaining burst is P3's 1 unit, so P3 runs.
- Not preempting when a shorter job arrives
- Assuming the first process continues until completion
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 performance impact of indirect pointers
Each level of indirection adds extra disk reads, increasing seek times and latency.Step 2: Analyze inode size constraints
Indirect pointers are stored in data blocks, not inodes, so inode size is fixed and not directly affected.Step 3: Clarify inode size growth
Inode size does not grow exponentially with indirect pointers; pointer blocks are separate.Step 4: Dispel encryption misconception
Indirect pointers do not inherently require encryption or extra CPU overhead.Final Answer:
Option C -> Option CQuick Check:
Performance degradation due to multiple disk seeks is the main limitation [OK]
- Confusing inode size with pointer block size
- Assuming inode size grows with indirect pointers
- Believing indirect pointers require encryption overhead
Solution
Step 1: Understand mode switch cost
Switching from user to kernel mode involves saving/restoring CPU state and flushing pipelines, which is expensive.Step 2: Why not all services as system calls
Excessive mode switches degrade performance, so only critical OS services use system calls.Step 3: Why other options are incorrect
Because system calls cannot access hardware devices is false; system calls are the mechanism to access hardware safely. Because user mode has unrestricted access to kernel data structures is false; user mode is restricted from kernel data. Because system calls bypass the CPU privilege checks is false; system calls enforce privilege checks via mode switch.Final Answer:
Option A -> Option AQuick Check:
Mode switch overhead limits system call usage [OK]
- Believing system calls cannot access hardware
- Thinking user mode has full kernel access
- Assuming system calls skip privilege checks
