GATE / CS ARCHIVE

GATE CSE 2024 SET 2 / QUESTION 25

A trap is not automatically a process switch

Operating Systems · Processes, Threads & System Calls · Full GATE CSE 2024 Set 2 paper

GATE 2024 Set 2, Q25 1 mark · MSQ
Report issue

Processes, Threads & System Calls

Question 25, GATE 2024: Running process P encounters one of these events. Which always move P to a non-running state in the intended model? A an actually blocking disk-read system call; B a page fault for a page in swap; C a disk interrupt delivering another process’s data; D a timer interrupt.
Tap to enlarge
Select all that apply
Answer & solution

Official answer: A, B

Approach: Ask whether P must wait for something unavailable, rather than merely whether control enters the kernel.

1. Derivation. A genuinely blocking disk read puts P into a waiting state while I/O completes. A fault on a page currently in swap also requires storage I/O, so P is blocked pending page-in. An interrupt for another process need not deschedule P, and a timer interrupt may return to P if no switch is needed. Thus A, B. A mere user-to-kernel mode switch is not necessarily a switch to a different process; blocking in A is taken as actual blocking, as stipulated.

2. Explanation and checks. For A, the CPU cannot complete P’s read until the requested I/O finishes; for B, execution cannot retry the memory access until the swapped page is brought into memory. Both create a reason to block P and run another process or idle. In C, handling an interrupt can make a different process ready without forcing immediate preemption. In D, the scheduler may choose P again. Kernel entry and saving a trap frame alone are not the requested process context switch.

Original paper, page 18 · Answer key