Practice
Solution
Step 1: Understand the role of PCB during state transitions
The PCB stores the process state, CPU registers, and scheduling information during context switches.Step 2: Analyze each option
A: PCB is created at process creation but its primary use is during context switches, not just at New to Ready.
B: PCB is involved in termination but mainly to release resources; it is not primarily used to delete data.
C: Processes in Ready state do not execute instructions directly; they wait for CPU allocation.
D: Correct. When a process moves from Running to Waiting, the PCB saves CPU registers and state for resumption.Final Answer:
Option D -> Option DQuick Check:
PCB is essential for saving CPU state during Running to Waiting transitions [OK]
- Thinking PCB is only used at process creation
- Assuming Ready state processes execute instructions
- Believing PCB is deleted immediately at termination
Solution
Step 1: Understand resource sharing scenario
Multiple identical resources mean more than one thread can access simultaneously but limited by resource count.Step 2: Evaluate synchronization primitives
Mutex and binary semaphore allow only one thread at a time, unsuitable for multiple identical resources.Step 3: Counting semaphore suitability
Counting semaphore maintains a count of available resources, allowing multiple threads up to the count.Step 4: Spinlock consideration
Spinlocks are low-level and busy-wait, not ideal for managing multiple identical resources efficiently.Final Answer:
Option D -> Option DQuick Check:
Counting semaphore matches the scenario of multiple identical resources.
- Confusing mutex with counting semaphore for multiple resources
- Assuming binary semaphore can handle multiple identical resources
- Believing spinlocks are suitable for resource counting
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: 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
Solution
Step 1: Understand quantum equal to longest burst
Setting quantum to longest burst means processes run mostly to completion without preemption.Step 2: Compare to FCFS
This behavior mimics FCFS, where processes run in arrival order without interruption.Step 3: Analyze fairness and turnaround
Fairness decreases because shorter processes wait longer, losing RR's time-sharing benefit. Turnaround time approaches FCFS values.Step 4: Evaluate incorrect options
Turnaround time decreases significantly and fairness improves due to fewer context switches is wrong because fewer context switches do not improve fairness. Fairness remains the same but turnaround time increases due to longer waiting times is wrong as fairness changes. Both turnaround time and fairness improve because processes get longer uninterrupted CPU bursts is wrong because fairness does not improve.Final Answer:
Option B -> Option BQuick Check:
Quantum = longest burst -> RR ≈ FCFS -> fairness ↓, turnaround ~ FCFS.
- Assuming fairness always improves with larger quantum
- Believing fewer context switches always reduce turnaround
- Ignoring that RR degenerates to FCFS with large quantum
