Nepedia
Back to Discover
Fluent Reader
💻

Preemption (computing)

technology Maturity 9-11 Next article →

Computers often seem to do many things at once. This is called multitasking. To make this work well, systems use something called preemption. Preemption is when a scheduler pauses a running task. This happens without the task asking for help. The goal is to resume the task later. This allows the computer to stay fast and responsive.

This process works through a method called context switching. A scheduler manages the work by using tiny bits of time. Each bit is called a time slice or a quantum. When a slice ends, an interrupt tells the system to switch. The scheduler then picks the next task to run. This gives every process a regular slice of time. It creates the illusion that many tasks happen at once.

In the past, computers used cooperative multitasking. In those systems, tasks had to give up control themselves. This was different from the preemptive way. Early microcomputer systems like OS-9 used preemption. Sinclair QDOS and AmigaOS also offered this as a core feature. These systems ran on Motorola 68000-family microprocessors. They helped computers manage many jobs more reliably.

Many famous systems now use preemptive multitasking. Modern versions of Windows, Linux, and macOS all use it. Linux has used it since version 2.5.4. Windows NT has always supported this method. Even Android uses it because it is based on Linux. Some early systems, like MS-DOS, did not support it at all. However, other systems like MP/M-86 did support it in 1981.

Preemption is very helpful for different types of tasks. Some tasks are CPU bound, which means they use the processor a lot. Other tasks are I/O bound, meaning they wait for things like a keyboard. In old systems, waiting tasks would just sit there and use the CPU. With preemption, the system can block these waiting tasks. This lets the CPU work on other important things instead. This makes the whole computer much more efficient.

328 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

More to explore

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.