Practice
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 TLB purpose
The TLB caches recent virtual-to-physical address translations to speed up address translation.Step 2: Analyze each option
A: High temporal locality means repeated accesses to the same pages, so TLB hits are frequent, improving performance.
B: Single-level page tables are fast, but TLB benefits more when page tables are large.
C: Small physical memory with no paging reduces need for TLB since address translation is trivial.
D: Sequential accesses may not reuse the same pages quickly, reducing TLB hit rate.Final Answer:
Option B -> Option BQuick Check:
TLB effectiveness depends on locality of reference, which is captured by when virtual memory accesses exhibit high temporal locality of page references.
- Assuming TLB is always beneficial regardless of access pattern
- Confusing physical memory size with TLB usefulness
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
