GateAI
Processes, Threads and IPC

GATE CSE 2024 Set 2 · Q25

MSQ1 markMedium

Time

Consider a process PP running on a CPU. Which one or more of the following events will always trigger a context switch by the OS that results in process PP moving to a non-running state (e.g., ready, blocked)?

Select all that applyOne or more correct

Pick every correct option

Solution

Step-by-step verified solution

Official answer: A) P makes a blocking system call to read a block of data from the disk; B) P tries to access a page that is in the swap space, triggering a page fault

Processes, Threads and IPC

A running process must leave the running state and undergo a context switch if it can no longer make progress on the CPU until some external operation completes:

  • (A) is correct: When process PP issues a blocking system call for disk I/O, it cannot proceed until the requested data is fetched from the secondary storage. The OS moves PP to the blocked/waiting state and schedules another ready process to run.

  • (B) is correct: A page fault occurs when PP accesses a page currently in swap space. Fetching the page from disk is a high-latency I/O operation; the OS immediately transitions PP to the blocked/waiting state while the page is brought into memory, triggering a context switch.

  • (C) is incorrect: An external I/O interrupt for another process is handled in the kernel mode via an Interrupt Service Routine (ISR). Once the ISR completes, if PP remains the highest-priority runnable process, execution of PP resumes immediately without moving PP to a non-running state.

  • (D) is incorrect: A timer interrupt occurs periodically to update system clocks and accounting. It only preempts PP and moves it to the ready state if PP's time slice has expired; if time remains or if PP is the only runnable task, PP continues execution without switching to a non-running state.

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Processes, Threads and IPC previous year question is Q25 of the GATE CSE 2024 Set 2 paper. Find more GATE CSE PYQs on Processes, Threads and IPC in Operating Systems, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Processes, Threads and IPC PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Processes, Threads and IPC in GATE CSE

Processes, Threads and IPC has 15 GATE CSE PYQs across 13 papers from 2011 to 2026. 4 of them are 1-mark MSQs like this one, and it is the only one in GATE CSE 2024 Set 2.

How GATE tests Processes, Threads and IPC

More from GATE CSE 2024 Set 2

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2024 Set 2 · Q25 · MSQ

Consider a process P running on a CPU. Which one or more of the following events will always trigger a context switch by the OS that results in process P moving to a non-running state (e.g., ready, blocked)?

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.