✓ 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. Trace the steps of address translation in a paging system when a process accesses a virtual address. Which sequence correctly describes the translation?
easy
A. Extract page number -> consult segment table -> get frame number -> add offset
B. Extract page number -> consult page table -> get frame number -> add offset
C. Extract segment number -> consult page table -> get frame number -> add offset
D. Extract segment number -> consult segment table -> get frame number -> add offset
Solution
Step 1: Identify paging address structure
Paging virtual address splits into page number and offset.
Step 2: Consult page table
Page number indexes into the page table to find the frame number.
Step 3: Calculate physical address
Physical address = frame number concatenated with offset.
Step 4: Analyze options
Extract page number -> consult page table -> get frame number -> add offset matches this sequence exactly.
Step 5: Why others are wrong
Options B, C, and D incorrectly involve segment tables or segment numbers, which are not part of pure paging address translation.
Final Answer:
Option B -> Option B
Quick Check:
Paging uses page tables, not segment tables, for translation.
2. Trace the sequence of state transitions for a process that requests I/O while running and then completes the I/O operation. What is the correct order of states the process goes through?
easy
A. Running -> Waiting -> Ready -> Running
B. Running -> Ready -> Waiting -> Running
C. Running -> Waiting -> Running -> Ready
D. Running -> Ready -> Running -> Waiting
Solution
Step 1: Identify the event
The process requests I/O while Running, so it must wait for I/O completion.
Step 2: State transition on I/O request
Process moves from Running to Waiting state to wait for I/O.
Step 3: After I/O completes
Process moves from Waiting to Ready state, waiting for CPU scheduling.
Step 4: CPU scheduling
Process moves from Ready to Running when CPU is allocated.
Hint: I/O request moves process Running -> Waiting, then Waiting -> Ready after I/O completes [OK]
Common Mistakes:
Confusing Ready and Waiting states order
Assuming process goes directly from Waiting to Running
Skipping the Ready state after I/O completion
3. 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.