Skip to content

13. Multithreading vs Multitasking vs Multiprogramming

1. Multiprogramming (1960s) — problem: CPU sat idle 80%+ of the time waiting on I/O. Fix: load several programs in RAM; switch when one blocks on I/O. Goal: maximize CPU utilization. No time slicing, no user interaction (batch).

2. Multitasking (1970s–80s) — problem: a CPU-bound job could hog the CPU forever under multiprogramming. Fix: a hardware timer forces a switch every quantum, regardless. Goal: responsiveness + fairness. Preemptive.

3. Multithreading (1990s–present) — problem: switching between heavy processes (full TLB flush) is expensive. Fix: multiple threads within one process, sharing memory, cheap to switch. Goal: concurrency + efficiency within a program.

Aspect Multiprogramming Multitasking Multithreading
UnitProgramProcessThread
Switch triggerI/O onlyTimer + I/OTimer + I/O + yield
MemorySeparateSeparateShared
GoalCPU utilizationResponsivenessConcurrency + efficiency
Context switch costHighHighLow
Era1960s1970s–80s1990s–now

Modern OSes run all three at once: multiple processes in RAM (multiprogramming), timer-preempted for fairness (multitasking), each running several threads (multithreading) — e.g., Chrome uses separate processes per tab and multiple threads within each tab.