Winter Semester 2026–27 · VIT-AP · BACSE106 · Operating Systems · Dr. Krithika L.B

CPU context switch mechanism

Animated save/restore between two PCBs.

Module 2 Session 2.1 Lesson 3 of 4

CPU Context Switch Mechanism

Operating System Concepts - State Save, State Restore & Scheduler Overhead

process P₀ operating system process P₁ executing interrupt or system call save state into PCB₀ reload state from PCB₁ executing interrupt or system call save state into PCB₁ reload state from PCB₀ executing idle idle idle
Context Switch Overview
Select any phase on the diagram to inspect CPU registers, Process Control Block (PCB) states, and OS actions.
📟 Active CPU Registers Simulation:
CPU Core: Executing P₀ | PC: 0x004010A0 | Regs: [R1=42, R2=100]
Key Operating System Rule: While the OS is performing a context switch (saving/reloading states), the CPU does no useful application work. This time spent is pure overhead.