← IGCSE Computer Science Paper 1

OS function: managing multitasking

The OS runs several programs at once by sharing CPU time in very short slices and switching quickly between them, so they appear to run together.

Understanding OS function: managing multitasking in IGCSE Computer Science Paper 1

What it does: The loop gives every open program a short turn on the CPU, which is how the OS shares CPU time between several programs. The OS switches quickly to the next program. The first program stays open and gets another slice later. Slices are tiny, often fractions of a second, which is why the programs appear to run together. The OS does the switching automatically and very quickly, not the user.

Common mistakes: The loop must go through the list of open programs, so it should be FOR EACH app IN apps. slice is just a number, so the loop has nothing to go through. Multitasking keeps sharing CPU time for as long as the computer is on, so it needs a repeating loop. It should be WHILE computer is on. An IF would only give each program one turn.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 373–389) and word search (Modules 356–389).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
How does a single-core CPU make several programs appear to run at the same time?
The CPU runs every program fully at the exact same instantThe OS shares CPU time between programs in very short slices
Matches
run(music_player) run(web_browser)
↓
Each program is run to the end before the next one starts, so the CPU time is not shared in short slices and the programs do not appear to run together.
Applying
Meanings
Term
multitasking
Meaning
The OS runs several programs at once by sharing CPU time in very short slices and switching quickly between them, so they appear to run together.
Practice
timeSlice ← 10
Testing
Gaps
OS function:
Check Answer
Spots
2slice ← 10
3FOR EACH app IN slice

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Armadillo' badge — Shield Bearer, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. How does a single-core CPU make several programs appear to run at the same time?
A. The OS shares CPU time between programs in very short slices ✓
B. The CPU runs every program fully at the exact same instant
The OS gives each program a tiny slice of CPU time and switches between them so quickly that they appear to run together.
2. Which OS function lets you listen to music while typing an essay and downloading a file?
A. Managing multitasking ✓
B. Managing user accounts
Multitasking is the OS function that lets several programs be open and running at once by sharing the CPU.
3. What does the OS do when a program's time slice ends?
A. It switches the CPU to another program ✓
B. It closes the program permanently
The OS switches quickly to the next program. The first program stays open and gets another slice later.
4. How long is each slice of CPU time a program gets?
A. Several minutes, until the program is finished
B. Very short, so switching looks instant to the user ✓
Slices are tiny, often fractions of a second, which is why the programs appear to run together.
5. Why must the OS keep each program's work separate during multitasking?
A. So only one program can be stored in RAM
B. So one program's data does not overwrite or mix with another's ✓
Each program needs its own data and place in memory so that switching between programs does not corrupt anything.

Match the Pairs

time_slice = 10 # milliseconds → The short period of CPU time given to one program before the OS moves on to the next program
switch_to(next_program) → The OS quickly changes the CPU from one running program to another so that all the programs keep making progress
Several programs are open at once, and the OS gives each one a turn on the CPU in a repeating loop → for program in open_programs: run(program, time_slice)
The OS keeps each program's work separate by storing its own data so one program does not overwrite another → memory[program] = own_data
run(music_player) run(web_browser) → Each program is run to the end before the next one starts, so the CPU time is not shared in short slices and the programs do not appear to run together.
one_program_at_a_time = True → This setting stops the OS from switching between programs, so only one program can use the CPU and multitasking cannot happen.

Key Term

multitasking
The OS runs several programs at once by sharing CPU time in very short slices and switching quickly between them, so they appear to run together.

Fill in the Blanks

1. OS function: multitasking
Hint: Type the name of the OS function that shares CPU time between several open programs.
2. giveCPU(program, timeSlice)
Hint: Type the variable name for the very short amount of CPU time each program gets in turn.
3. saveState(currentProgram)
Hint: Type the function that stores a program's own work before the CPU switches to another program.
4. IF programs > 1 THEN multitasking ← TRUE
Hint: Type the comparison operator that checks whether more than one program is open at once.
5. WHILE timeLeft > 0 DO run(program)
Hint: Type the keyword that repeats an instruction for as long as part of the time slice remains.

Spot the Error

Question 1
A apps ← [Game, Music, Chat]
B slice ← 10
C FOR EACH app IN slice
D CPU runs app for slice ms
E NEXT app
Line C — The loop must go through the list of open programs, so it should be FOR EACH app IN apps. slice is just a number, so the loop has nothing to go through.
Question 2
A IF computer is on
B run Browser for 1 slice
C run Music for 1 slice
D ENDWHILE
Line A — Multitasking keeps sharing CPU time for as long as the computer is on, so it needs a repeating loop. It should be WHILE computer is on. An IF would only give each program one turn.
Question 3
A CPU runs Music for one slice
B Music must finish completely
C OS saves Music's progress
D OS loads Chat's progress
E CPU runs Chat for one slice
Line B — The OS switches programs when the time slice ends, not when the program finishes. The line should say the time slice ends, for example 'Time slice ends'.
Question 4
A Music ← memory block A
B Chat ← memory block A
C Blocks do not overlap
D Each program stays separate
Line B — Each program's work must be kept separate. Chat has to use a different block (B), otherwise it would overwrite Music's data in block A.
Question 5
A slice ← 10
B WHILE apps are open
C CPU runs app for slice ms
D Stay on the same app
E ENDWHILE
Line D — After each short slice the OS must switch quickly to the next program. Staying on the same app would stop the others from running, so the line should be 'Switch to next app'.

Student with a class code? Join your class →