Practice
Solution
Step 1: Identify circular wait
Each process holds a resource and waits for another held by the next process, forming a cycle.Step 2: Understand consequences
Because each process waits for a resource held by another in the cycle, none can proceed, causing indefinite waiting.Step 3: Analyze other options
One process releases its resource voluntarily, breaking the cycle immediately assumes voluntary release, which is not guaranteed. The operating system preempts resources from one process to resolve the wait involves preemption, which is not part of the circular wait condition. Processes detect the cycle and terminate themselves automatically assumes automatic termination, which is not standard behavior.Final Answer:
Option A -> Option AQuick Check:
Circular wait leads to indefinite blocking without external intervention.
- Assuming processes will release resources voluntarily
- Confusing circular wait with preemption or automatic recovery
Solution
Step 1: Understand resource sharing in threads
Threads within the same process share memory and resources, allowing efficient communication and lower overhead compared to processes.Step 2: Compare overhead of context switching
Thread context switching is lighter than process context switching, making threads better for high concurrency.Step 3: Evaluate options
Use multiple processes, each handling a single client request independently uses processes, which have higher overhead and less efficient resource sharing. Use a single-threaded process with blocking I/O for all requests is single-threaded and blocks, limiting concurrency. Use multiple processes with shared memory segments for communication adds complexity with shared memory and still has process overhead.Final Answer:
Option A -> Option AQuick Check:
Threads maximize resource sharing and minimize overhead for concurrent tasks [OK]
- Assuming processes are always better for concurrency
- Ignoring context switching overhead differences
- Believing shared memory between processes is as simple as threads
Solution
Step 1: Understand FIFO Eviction Policy
FIFO evicts the oldest loaded page, not the least recently used.Step 2: Evaluate Each Option
FIFO can suffer from Belady's anomaly where increasing frames increases page faults is correct; Belady's anomaly can occur with FIFO.
FIFO always evicts the least recently used page is incorrect; FIFO does not track recency of use.
FIFO is simple to implement with a queue data structure is correct; FIFO uses a queue for eviction order.
FIFO does not consider how frequently or recently a page was accessed is correct; FIFO ignores frequency and recency.Final Answer:
Option A -> Option AQuick Check:
FIFO evicts by arrival order, not usage recency.
- Confusing FIFO with LRU eviction criteria
- Assuming FIFO tracks page usage
- Believing FIFO cannot have anomalies
Solution
Step 1: Understand aging purpose
Aging gradually increases the priority of waiting processes to ensure they eventually get CPU time, preventing starvation.Step 2: Identify downside
Over-aggressive aging can cause priority inversion, where lower-priority processes gain higher priority than intended, disrupting scheduling fairness.Step 3: Analyze options
Aging increases priority of waiting processes to prevent starvation but can cause priority inversion if overused correctly states aging's purpose and downside. Aging decreases priority of high-priority processes to prevent deadlock but may cause livelock incorrectly associates aging with deadlock prevention and livelock. Aging randomly changes priorities to balance load but can lead to starvation of critical processes misrepresents aging as random priority changes. Aging forces processes to release resources periodically but increases overhead significantly confuses aging with resource release policies.Final Answer:
Option A -> Option AQuick Check:
Aging = priority boost to prevent starvation, risk of priority inversion.
- Confusing aging with deadlock prevention
- Thinking aging randomly changes priorities
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
