✓ FCFS scheduling runs processes in strict arrival order without preemption, causing long processes to delay all subsequent ones.
This convoy effect is difficult to visualize from code alone but becomes clear when watching the Gantt chart build step-by-step.
✓ Waiting time accumulates for later processes because they must wait for all earlier processes to finish, regardless of their own burst times.
Seeing the ready queue and CPU state at each step helps understand how waiting time builds up.
✓ The Gantt chart visually shows how CPU time is allocated sequentially, making it easy to identify bottlenecks caused by long bursts.
This visual insight clarifies why average waiting time can be high even if some processes arrive early.
Practice
(1/5)
1. In which scenario is Round Robin scheduling with a fixed time quantum most appropriate compared to First-Come-First-Serve or Priority scheduling?
easy
A. When processes have highly variable CPU burst times and fairness among all processes is required
B. When all processes have identical priorities and long CPU bursts
C. When minimizing average turnaround time is the only goal
D. When processes have strict deadlines and real-time constraints
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 A
Quick Check:
RR is best when fairness and responsiveness matter, especially with variable burst times.
Hint: RR = fairness with variable bursts
Common Mistakes:
Assuming RR always minimizes turnaround time
Believing RR suits real-time deadlines
Confusing RR with priority-based scheduling
2. Trace the sequence of events when a process exceeds its working set size causing thrashing. What happens step-by-step inside the system?
easy
A. The process generates page faults, the OS increases its frame allocation, and thrashing stops immediately
B. The process generates page faults, the OS swaps out pages not in the working set, but thrashing continues due to insufficient frames
C. The process generates page faults, the OS ignores them, and the process continues without delay
D. The process generates page faults, the OS reduces the number of processes to free frames, preventing thrashing
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 B
Quick Check:
Thrashing occurs when working set exceeds frames; OS tries to swap but may fail if frames are insufficient.
Confusing immediate load control with page fault handling
3. What is a key limitation of the Banker's Algorithm that affects its practical use in modern operating systems?
medium
A. It requires processes to declare their maximum resource needs in advance, which is often impractical.
B. It can only handle a single resource type, limiting its applicability.
C. It always leads to deadlocks if the system is heavily loaded.
D. It preempts resources from processes, causing starvation.
Solution
Step 1: Identify Banker's Algorithm assumptions
The algorithm requires prior knowledge of maximum resource needs for each process.
Step 2: Analyze limitations
This requirement is often unrealistic in dynamic or unpredictable environments.
Step 3: Evaluate other options
B is false; Banker's Algorithm handles multiple resource types. C is false; it avoids deadlocks rather than causing them. D is false; it does not preempt resources.
Final Answer:
Option A -> Option A
Quick Check:
Pre-declaration of max needs is the main practical limitation.
Hint: Banker's Algorithm needs max resource claims upfront [OK]
Common Mistakes:
Thinking it only supports one resource type
Believing it causes deadlocks under load
Confusing it with preemptive algorithms
4. What is a key limitation of the working set model in preventing thrashing that candidates often overlook?
medium
A. It requires tracking all page references, which can be expensive and complex
B. It guarantees zero page faults once the working set is allocated
C. It works best when all processes have identical working set sizes
D. It eliminates the need for load control mechanisms
Solution
Step 1: Understand working set model overhead
The model requires monitoring page references over time windows, which can be costly.
Step 2: Analyze options
A is correct because tracking page references precisely is resource-intensive. B is incorrect because even with working set allocation, some page faults can occur. C is incorrect because working set sizes vary widely among processes. D is incorrect because load control is still needed when total working sets exceed memory.
Final Answer:
Option A -> Option A
Quick Check:
Working set tracking overhead is a practical limitation often underestimated.
Hint: Working set tracking = overhead cost
Common Mistakes:
Assuming working set eliminates all page faults
Believing all processes have similar working sets
Ignoring the need for load control
5. If a system uses the working set model but still experiences thrashing under heavy load, which advanced technique should be applied next to mitigate thrashing?
hard
A. Increase the working set window size to capture more pages per process
B. Implement load control to reduce the number of active processes competing for frames
C. Disable page replacement algorithms to avoid unnecessary page faults
D. Assign a fixed number of frames to each process regardless of working set size
Solution
Step 1: Understand why thrashing persists despite working set model
Even with working set allocation, total demand may exceed physical memory.
Step 2: Analyze options
A is incorrect because increasing window size may increase working set size, worsening thrashing. B is correct because load control reduces active processes, lowering total memory demand. C is incorrect because disabling page replacement is not feasible and increases faults. D is incorrect because fixed allocation ignores dynamic working sets, risking thrashing.
Final Answer:
Option B -> Option B
Quick Check:
Load control is the next step after working set model to prevent thrashing under overload.
Hint: Load control = reduce active processes to fit memory