In simple terms
A friendly intro before the formal notes — no formulas yet.
The OS as a Restaurant Manager
The Operating System manages your computer's resources just like a restaurant manager handles tables, chefs, and ingredients. It decides which task gets what resource and when, ensuring everything runs smoothly and efficiently.
Imagine a busy restaurant on a Saturday night. The manager is the Operating System. Customers arriving are 'processes' needing service. The manager (scheduler) must decide who gets a table (CPU time) and in what order. A simple 'first-come, first-served' approach might leave a solo diner waiting behind a large party ordering a three-course meal. A better manager might quickly serve the solo diner first to free up a table, optimising the overall customer flow. This is the essence of resource management and scheduling in a computer.
- 1
A process arrives, requesting CPU time and other resources, like a customer entering the restaurant.
- 2
The OS scheduler places the process in a 'ready queue', which is like the waiting area for a table.
- 3
The scheduler selects a process from the queue based on an algorithm (e.g., first-come, first-served) and allocates the CPU to it.
- 4
The process runs until it completes, waits for an I/O operation, or its time slice expires, at which point the scheduler allocates the CPU to the next process.
Explore the concept
Use the live diagram and synced steps — play it or tap a step card to walk through.
Full topic notes
Formal explanation with the rigour you need for the exam.
Identifying System Resources
A computer system has a finite set of resources that must be shared among various programs and users. The OS acts as the manager for these resources. The main categories are:
CPU (Central Processing Unit): The 'brain' of the computer. The OS must schedule which process gets to use the CPU at any given moment.
Primary Memory (RAM): Volatile memory where currently running programs and their data are stored. The OS allocates memory space to each process and ensures they don't interfere with each other.
I/O Devices: Includes input devices (keyboard, mouse), output devices (printer, monitor), and storage devices (HDD, SSD). The OS manages access to these devices to prevent conflicts.
Files and Data: The OS manages the file system, controlling who can access, create, and delete files on secondary storage.
The Scheduler and Scheduling Algorithms
The low-level scheduler (or dispatcher) is the part of the OS that decides which of the ready processes will be allocated the CPU. Its goal is to optimise system performance based on certain criteria, such as maximising CPU utilisation or minimising response time for users. To do this, it employs a scheduling algorithm. There is no single 'best' algorithm; the choice depends on the system's requirements (e.g., a real-time system has different needs from a batch processing system).
Non-Preemptive Algorithm: First-Come, First-Served (FCFS)
This is the simplest scheduling algorithm. As processes become ready, they are added to the end of a queue. The process at the front of the queue is selected for execution and runs until it completes or blocks for I/O. It is non-preemptive, meaning once a process has the CPU, it cannot be taken away. While fair in a sense, it can suffer from the 'convoy effect', where a long process makes many shorter processes wait.
Preemptive Algorithms: Round Robin (RR)
Round Robin is a preemptive algorithm designed especially for time-sharing systems. It is similar to FCFS, but preemption is added to switch between processes. A small unit of time, called a time quantum or time slice (typically 10-100 ms), is defined. The ready queue is treated as a circular queue. The scheduler goes around the queue, allocating the CPU to each process for a time interval of up to one time quantum. This prevents any single process from hogging the CPU.
In exams, you will often be asked to compare scheduling algorithms. Make sure you can clearly state the pros and cons of each. For example, FCFS is simple but has the convoy effect. SJF is optimal for average wait time but risks starvation and requires future knowledge. RR is fair but has overhead from context switching and its performance depends on the quantum size.
Worked examples
See the formulas applied — reveal one step at a time, like the exam.
Four processes arrive as shown in the table. Using the First-Come, First-Served (FCFS) algorithm, calculate the average waiting time and average turnaround time. All times are in milliseconds (ms).
| Process | Arrival Time | Burst Time |
|---|---|---|
| P1 | 0 | 7 |
| --- | --- | --- |
| P2 | 2 | 4 |
| P3 | 4 | 1 |
| P4 | 5 | 4 |
- 1
With FCFS, processes are served in the order they arrive: P1, P2, P3, P4.
Using the same processes from the previous example, calculate the average waiting time and average turnaround time using the Round Robin (RR) algorithm with a time quantum of 3 ms.
| Process | Arrival Time | Burst Time |
|---|---|---|
| P1 | 0 | 7 |
| --- | --- | --- |
| P2 | 2 | 4 |
| P3 | 4 | 1 |
| P4 | 5 | 4 |
- 1
With RR and a quantum of 3ms, processes will be preempted.
How it all connects
The big idea sits in the middle — tap a linked idea to explore the link.
Tap a linked idea to see how it connects back to the main topic — that connection is what examiners reward.
Glossary
Try to recall each definition before you reveal it.
Quick check
Answer in your head first — then tap to check. No pressure.
Revision flashcards
Flip the card. Test yourself before the exam.
What is Resource Management in an OS?
The task of allocating and managing system resources (CPU, memory, I/O devices) among competing processes to ensure efficient and fair operation of the computer system.
Key takeaways
Review these before you close the topic — retrieval beats re-reading.
- ✓
CPU (Central Processing Unit): The 'brain' of the computer. The OS must schedule which process gets to use the CPU at any given moment.
- ✓
Primary Memory (RAM): Volatile memory where currently running programs and their data are stored. The OS allocates memory space to each process and ensures they don't interfere with each other.
- ✓
I/O Devices: Includes input devices (keyboard, mouse), output devices (printer, monitor), and storage devices (HDD, SSD). The OS manages access to these devices to prevent conflicts.
- ✓
Files and Data: The OS manages the file system, controlling who can access, create, and delete files on secondary storage.
Practice — then mark it
The whole point: a real Cambridge question, marked mark-by-mark.
Test Your Knowledge on Resource Management
Test Your Knowledge on Resource Management
Extra simulations & links
PhET, GeoGebra and other curated tools — open in a new tab.
Frequently asked
Checkpoint
One marked question is worth ten re-reads — close the loop before you move on.
Reading it isn’t knowing it — prove it.
Before you move on: do Test Your Knowledge on Resource Management on paper, snap a photo, and get examiner-style feedback on exactly where you win and lose marks.