Practice
Solution
Step 1: Identify Peterson's solution scope
Peterson's algorithm is designed specifically for two processes to achieve mutual exclusion without hardware support.Step 2: Analyze other options
When multiple processes (more than two) need to synchronize access to a shared resource is incorrect because Peterson's solution does not scale beyond two processes. When processes require synchronization but can tolerate starvation is wrong because Peterson's solution guarantees bounded waiting, preventing starvation. When the system supports preemptive multitasking with priority-based scheduling is irrelevant since Peterson's algorithm is independent of scheduling policies.Final Answer:
Option A -> Option AQuick Check:
Peterson's solution is a classic two-process synchronization algorithm without hardware atomic instructions.
- Assuming Peterson's works for more than two processes
- Confusing bounded waiting with starvation allowance
- Believing hardware support is required
Solution
Step 1: Understand 'Hold and Wait'
This condition requires a process to hold at least one resource while waiting to acquire additional resources. A process holds one resource and waits to acquire another resource already held by another process directly describes this scenario.Step 2: Analyze other options
A process requests all required resources at once before execution begins avoids hold and wait by requesting all resources upfront. A process releases all resources before requesting new ones releases resources before requesting new ones, preventing hold and wait. A process can forcibly preempt resources from other processes describes preemption, which is a different condition.Final Answer:
Option D -> Option DQuick Check:
Only a process holding one resource and waiting to acquire another resource already held by another process matches the hold and wait condition necessary for deadlock.
- Confusing hold and wait with requesting all resources at once
- Thinking preemption is part of hold and wait
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: 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: Review each statement
A, B, and D correctly describe standard process states.
C incorrectly states that a Terminated process can return to Ready, which violates the model.Step 2: Understand Terminated state
Terminated means process execution is complete; it cannot be restarted or moved back.Final Answer:
Option C -> Option CQuick Check:
Terminated processes cannot be revived in the five-state model [OK]
- Thinking Terminated processes can be restarted
- Confusing Waiting with Ready state
- Misunderstanding New state as Ready
