Practice
Solution
Step 1: Understand Round Robin's fairness goal
Round Robin scheduling is designed to allocate CPU time slices fairly among all processes, especially when burst times vary widely.Step 2: Analyze other options
When all processes have identical priorities and long CPU bursts is less suitable because identical priorities and long bursts favor FCFS or SJF for efficiency, not fairness. When minimizing average turnaround time is the only goal ignores fairness and focuses only on turnaround time, which RR does not optimize. When processes have strict deadlines and real-time constraints requires real-time guarantees, which RR cannot provide due to its time slicing.Final Answer:
Option A -> Option AQuick Check:
RR is best when fairness and responsiveness matter, especially with variable burst times.
- Assuming RR always minimizes turnaround time
- Believing RR suits real-time deadlines
- Confusing RR with priority-based scheduling
Solution
Step 1: Identify what happens when working set is exceeded
The process causes frequent page faults because its active pages exceed allocated frames.Step 2: OS response
The OS attempts to swap out pages not in the working set to free frames, but if frames are insufficient, thrashing persists.Step 3: Analyze options
A is incorrect because OS cannot always increase frames immediately; thrashing may continue.
B is correct as it describes the OS swapping out pages but thrashing continuing due to frame shortage.
C is incorrect because OS does not ignore page faults.
D is incorrect because load control (reducing processes) is a prevention technique but not an immediate response to page faults.Final Answer:
Option B -> Option BQuick Check:
Thrashing occurs when working set exceeds frames; OS tries to swap but may fail if frames are insufficient.
- Assuming OS can instantly allocate more frames
- Believing OS ignores page faults
- Confusing immediate load control with page fault handling
Solution
Step 1: Understand mutual exclusion
It requires that some resources be non-shareable, meaning only one process can use them at a time.Step 2: Analyze why eliminating mutual exclusion for all resources is impractical
Eliminating mutual exclusion for all resources is impossible because some resources (like printers) inherently cannot be shared.Step 3: Evaluate other options
Mutual exclusion means that at least one resource must be held in a non-shareable mode correctly defines mutual exclusion. Mutual exclusion is necessary for deadlock but not sufficient alone correctly states it is necessary but not sufficient. Mutual exclusion applies only to resources that cannot be simultaneously used by multiple processes correctly limits mutual exclusion to non-shareable resources.Final Answer:
Option B -> Option BQuick Check:
Mutual exclusion cannot be eliminated for all resources; some must be exclusive.
- Thinking mutual exclusion can be removed entirely
- Confusing necessity with sufficiency
- Misapplying mutual exclusion to shareable resources
Solution
Step 1: Analyze each statement
Imposing a strict ordering on resource acquisition always prevents deadlock is correct: ordering resources prevents circular wait; Allowing a philosopher to pick up both forks only if both are available prevents deadlock is correct: atomic acquisition avoids partial hold; Breaking one of the four Coffman conditions is sufficient to prevent deadlock is correct: breaking any Coffman condition prevents deadlock.Step 2: Evaluate Using asymmetric fork picking (odd philosophers pick left first, even pick right first) guarantees no starvation
Asymmetric fork picking prevents deadlock but does not guarantee no starvation, as some philosophers may be repeatedly delayed.Final Answer:
Option A -> Option AQuick Check:
Only Using asymmetric fork picking (odd philosophers pick left first, even pick right first) guarantees no starvation incorrectly claims starvation is guaranteed prevented.
- Assuming deadlock prevention implies starvation freedom
- Believing asymmetric picking solves all synchronization issues
- Confusing Coffman conditions with starvation conditions
Solution
Step 1: Identify the problem
When a low-priority process holding a critical resource is preempted by a higher-priority process (due to aging), priority inversion can occur because the resource holder cannot proceed to release the resource.Step 2: Understand mitigation
Priority inheritance protocols temporarily raise the priority of the resource-holding process to prevent inversion and reduce blocking time.Step 3: Analyze options
Priority inversion may occur, delaying the critical resource release; mitigation involves priority inheritance protocols correctly identifies priority inversion and its mitigation. Deadlock will occur immediately; mitigation requires disabling aging incorrectly claims deadlock occurs immediately and suggests disabling aging, which is not a solution. Livelock will occur due to continuous priority changes; mitigation involves fixed priorities confuses livelock with priority changes. Starvation will worsen for low-priority processes; mitigation involves removing aging incorrectly states starvation worsens and suggests removing aging, which would increase starvation risk.Final Answer:
Option C -> Option CQuick Check:
Priority inversion + priority inheritance = correct diagnosis and fix.
- Confusing priority inversion with deadlock
- Thinking aging always prevents all scheduling issues
