KS3 & GCSE Computing · GCSE

Multitasking and Context Switching Explained — GCSE Computer Science

Understand multitasking and context switching for GCSE Computer Science: how operating systems run multiple processes, time slicing, and the process control block.

Duke Harewood — author of AI Tutors for Key Stage 3Updated 5 min read

On this page

Short answer

Multitasking is an operating system's ability to run several programs apparently simultaneously on a single CPU core. It works through context switching — rapidly pausing one process, saving its state, and loading another. The switches happen so quickly that all programs appear to run at once.

At a glance

Key stage
GCSE
Subject
Computing
Type
Explainer
For
Students
Read time
5 min
Last updated
21 October 2026

Where this fits

  1. Key Stage 3Years 7–9
  2. GCSEYears 10–11This article
This article is aimed at GCSE (Years 10–11), the stage after Key Stage 3 (Years 7–9).

Method at a glance

  1. The OS saves the current process's state — all register values, the…
  2. The scheduler selects the next process to run from the ready queue
  3. The OS loads the saved state from that process's PCB into the CPU…
  4. Execution resumes from exactly where that process was last paused
The 4 numbered steps in this article, in order.

What is a process?

A process is a program in the act of running. When you open a web browser, a media player, and a word processor at the same time, the operating system creates three separate processes. Each process has its own:

  • section of memory (code, data, stack),
  • set of CPU register values (the current state of computation),
  • process ID (PID) — a unique number assigned by the OS,
  • current state: running, ready, or waiting (blocked).

A process is not the same as the program file on disk — the file is static instructions; the process is the live, executing instance of those instructions.

What is context switching?

A context switch is the mechanism by which the CPU moves from executing one process to another. The CPU can only truly execute one process at a time on a single core, so the operating system's scheduler decides which process runs and for how long.

When it is time to switch:

  1. The OS saves the current process's state — all register values, the program counter, and other data — into a data structure called the Process Control Block (PCB).
  2. The scheduler selects the next process to run from the ready queue.
  3. The OS loads the saved state from that process's PCB into the CPU registers.
  4. Execution resumes from exactly where that process was last paused.

This save-and-restore cycle is a context switch.

What is the Process Control Block?

The Process Control Block (PCB) is a record maintained by the OS for every active process. It holds everything needed to pause and later resume a process:

Field Contents
Process ID (PID) Unique identifier
Program Counter (PC) Address of the next instruction to execute
CPU registers Values of all general-purpose and special registers
Process state Running / Ready / Waiting
Memory information Base and limit addresses of allocated RAM
Priority Scheduling priority level
I/O status List of open files and devices

Think of the PCB as a bookmark — it records exactly where a book was left open (the program counter) together with notes on everything the reader had in mind (register values), so the book can be picked up and continued perfectly later.

What is time slicing?

Time slicing (also called time-sharing) is the technique of dividing CPU time into small fixed intervals called time quanta (typically 10–100 milliseconds). The scheduler gives each ready process a time quantum; when the quantum expires, a context switch occurs and the next process gets its turn.

Time quantum Process running
0–20 ms Browser
20–40 ms Music player
40–60 ms Word processor
60–80 ms Browser (second slot)
… …

Because each switch takes only microseconds and the human eye cannot distinguish changes faster than about 50 ms, all three programs appear to run simultaneously — that is the illusion of multitasking.

What is the difference between multitasking and parallel processing?

Concept Description Hardware required
Multitasking One CPU rapidly switches between processes (concurrent) Single core
Parallel processing Multiple CPUs or cores run different processes truly simultaneously Multiple cores

A modern computer does both: each core multitasks (running many processes per core through time slicing) and multiple cores genuinely run different processes in parallel. At GCSE, multitasking and context switching refer to the single-core concurrent model.

Why does context switching have a cost?

Saving and loading the PCB takes CPU cycles that could otherwise be doing useful work — this is called overhead. If time quanta are very short, the CPU spends a disproportionate fraction of its time context-switching rather than running processes. Conversely, if quanta are too long, interactive programmes feel sluggish because a user's keystroke might wait a full second before the relevant process gets CPU time. The OS scheduler is designed to balance these competing demands.

Frequently asked questions

How does the operating system decide which process runs next?

The scheduler uses a scheduling algorithm to pick the next process from the ready queue. Common algorithms include:

  • Round Robin — processes take turns in a fixed cycle (related to time slicing above),
  • Priority scheduling — higher-priority processes run first,
  • Shortest Job First (SJF) — the process estimated to take the least time runs next. At GCSE, round-robin and priority scheduling are the most commonly examined examples.

What is the difference between a process and a thread?

A thread is a lightweight unit of execution within a single process. One process can contain multiple threads that share the same memory space. Context switching between threads of the same process is faster than between different processes because no memory address space needs to change. Multi-threading is used in applications such as web browsers where one thread handles downloads while another handles the user interface.

Can context switching cause bugs?

Yes. In multi-threaded programs, two threads may try to modify the same variable simultaneously — a problem called a race condition. The result depends on which thread wins the context-switch lottery, making the bug non-deterministic and difficult to reproduce. Operating systems provide tools such as mutexes and semaphores to lock shared resources and prevent race conditions. At GCSE, knowing that concurrency introduces synchronisation challenges is sufficient.

How is multitasking relevant to the GCSE exam?

GCSE questions on operating systems frequently ask students to explain how an OS manages multiple processes. Expect to describe the scheduler, explain what the PCB stores and why it is needed, and describe context switching in the correct sequence: save state → select next process → load state → resume. Drawing the save/load sequence step by step usually earns full marks.


For Socratic GCSE tutoring and free Computer Science flashcards, see aitutors.me.

Key terms

  • Multitasking
  • context switching
  • process
  • memory
  • CPU register values
  • process ID (PID)
  • state
  • context switch

Sources