Types of Operating System
The same three jobs run through batch, multiprogramming and time-sharing, on one shared time axis.
Skip to the animationThe classic types of operating system — batch, multiprogrammed, time-sharing, real-time — are really one question answered four ways: when is the OS allowed to take the CPU away from a running job?
The problem all of them are solving
A CPU executes billions of instructions per second. A disk takes several milliseconds to answer — millions of CPU cycles of nothing. Almost every real program alternates between short CPU bursts and long I/O waits.
So the machine's efficiency comes down to one question: what happens to the CPU while a job is waiting for its disk? The history of operating systems is a sequence of better answers.
Batch systems
Jobs are collected together and run one at a time, to completion. You submitted a deck of punched cards and came back hours later for the printout. There is no interaction — you cannot influence a job once it is running, because there is no way to reach it.
When a job blocks on I/O the CPU simply idles, because no other job is allowed to start. Utilisation is poor and the last job in the queue waits for all of the ones ahead of it.
Multiprogramming
Keep several jobs in memory at once. When the running one blocks for I/O, hand the CPU to another that is ready. When the first job's data arrives, it queues up for its next turn.
This is the idea that made operating systems necessary — it needs memory protection (jobs are resident simultaneously), a scheduler, and interrupt handling. Its goal is CPU utilisation: keep the expensive part busy.
The switch happens only when a job *chooses* to block. A job in a pure computation loop can hold the CPU forever, and nothing can stop it.
Time-sharing (multitasking)
Add a hardware timer that interrupts every few milliseconds. Now the OS regains control whether the running job likes it or not, and can rotate the CPU among all of them. Each user gets the illusion of a private machine.
The goal changes from utilisation to response time. Switching more often costs a little throughput — every context switch is real work thrown away — and buys a lot of interactivity. Every desktop, phone and server you have used is a time-sharing system.
The rest of the family
- Real-time
- Correctness depends on *when* the answer arrives, not just what it is. Hard real-time guarantees a deadline (engine control, pacemakers, airbags); soft real-time merely prioritises it (video playback, where a late frame is ugly but not fatal). Note it is about predictability, not raw speed.
- Distributed
- Many machines presented to the user as one. Adds network failure, clock skew and consistency to every problem the OS already had.
- Network
- Machines stay visibly separate; the OS just provides shared services — files, printers, logins — across them.
- Embedded / mobile
- Fixed hardware, tight memory and power budgets, often a real-time core. Your phone's OS is a time-sharing system that also cares enormously about battery.
Side by side
| Type | CPU is taken away… | Optimises for |
|---|---|---|
| Batch | never — job runs to completion | throughput, simplicity |
| Multiprogramming | when the job blocks on I/O | CPU utilisation |
| Time-sharing | on a timer, at any moment | response time |
| Real-time | by deadline priority | meeting deadlines predictably |
Watch it work
Check yourself
question 1 / 4
One question at a time. Pick an answer to see why it is right or wrong, then move on — there is no score to keep and nothing is saved.