Skip to content
Official PYQ · 1999

GATE CS 1999 Q2.12 — Processes and Threads

Explain with AI

Which of the following actions is/are typically not performed by the operating system when switching context from process AA to process BB?

Choose one option
View worked solution

Answer: C

A context switch is the mechanism of saving the state (context) of a running process so that it can be resumed later, and loading the saved state of another process. It needs to be extremely fast to maintain system responsiveness.

Let us analyze the given actions during a context switch from process AA to process BB:

  • Option A (Saving and restoring registers): This is the core task of a context switch. The CPU registers (including the program counter, stack pointer, and general-purpose registers) of process AA must be saved to its Process Control Block (PCB), and those of process BB must be restored.
  • Option B (Changing address translation tables): Since different processes have distinct virtual address spaces, the operating system must update the page table base register (e.g., CR3 in x86) to point to process BB's page table.
  • Option C (Swapping out the memory image to disk): Swapping a process's entire memory image to disk is a heavy I/O operation managed by the medium-term scheduler. It is not performed during a standard context switch, as doing so would make context switching prohibitively slow.
  • Option D (Invalidating the TLB): Because the virtual-to-physical address mappings change when switching to a new process, the Translation Look-aside Buffer (TLB) must be invalidated (flushed) to prevent process BB from accessing cached translations belonging to process AA (unless address space identifiers/tags are used).

Therefore, swapping out the memory image to disk (Option C) is typically not performed during a context switch.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Processes and Threads questions