Practice
Solution
Step 1: Recall the Banker's Algorithm request sequence
First, it checks if the request is within the process's maximum declared need.Step 2: Next step after need check
The algorithm then verifies if the requested resources are available in the system's current available pool.Step 3: Subsequent steps
If available, it simulates allocation and checks for safe state, but this occurs after availability check.Final Answer:
Option D -> Option DQuick Check:
Availability check precedes simulation to avoid unnecessary computation.
- Assuming simulation happens before availability check
- Believing requests are granted immediately after need check
- Thinking preemption is part of Banker's Algorithm
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: Review privilege separation
User mode is restricted; kernel mode has full privileges.Step 2: Validate each statement
User mode code cannot directly access kernel memory for protection reasons. is true; user mode cannot access kernel memory. Kernel mode has unrestricted access to all hardware and memory. is true; kernel mode has full access. Mode switches are triggered by traps or interrupts to ensure controlled privilege escalation. is true; traps/interrupts cause mode switches.Step 3: Identify incorrect statement
System calls execute entirely in user mode without switching to kernel mode. is false; system calls require switching to kernel mode to execute privileged operations.Final Answer:
Option D -> Option DQuick Check:
System calls always involve mode switch to kernel [OK]
- Believing system calls run entirely in user mode
- Confusing hardware interrupts with system calls
- Assuming user mode can access kernel memory
Solution
Step 1: Understand resource ordering
Ordering resources prevents circular wait by forcing processes to request resources in a global order.Step 2: Identify drawbacks
Strict ordering can cause processes to wait longer than necessary, reducing concurrency and system throughput.Step 3: Analyze other options
The system can still deadlock due to hold and wait despite ordering is incorrect because ordering eliminates circular wait, thus preventing deadlock from that condition. No preemption condition is violated by enforcing ordering is false; ordering does not violate no preemption. Mutual exclusion is no longer required when ordering is enforced is false; mutual exclusion is still required for non-shareable resources.Final Answer:
Option A -> Option AQuick Check:
Ordering trades off concurrency for deadlock prevention.
- Believing ordering removes all deadlock conditions
- Confusing ordering with preemption
- Assuming mutual exclusion is eliminated by ordering
Solution
Step 1: Understand Waiting state semantics
Waiting means blocked until the awaited event(s) complete.Step 2: Multiple I/O waits in five-state model
The model treats Waiting as a single state without differentiating multiple simultaneous waits.Step 3: Limitation
This means the process stays in Waiting until all I/O events complete, limiting fine-grained concurrency.Final Answer:
Option B -> Option BQuick Check:
Five-state model does not handle multiple simultaneous waits distinctly [OK]
- Assuming process moves to Ready after any I/O completes
- Believing process can split into multiple processes automatically
- Thinking process polls I/O events while Running
