Preemption
Preemption is the interruption or displacement of active execution or resource allocation so another eligible activity can proceed.
Grokking Concurrency
Preemptive multitasking is an operating-system technique in which the system can suspend a running task without requiring its cooperation and schedule another task.
- How it is used
- Uses preemptive multitasking to share processor time and support concurrent work, including I/O-bound tasks.
- How deep it goes
- Explains time slices, interrupts, and interleaving, then illustrates scheduling with a timer-driven arcade model and a threaded server.
- Examples
- Illustrates preemption with an arcade machine and a server that assigns each client a thread.
- What you can do after
- Evaluate preemption as a way to share CPU time, recognizing switching overhead and the difference between concurrency and parallelism.
Robotics for Programmers
Preemption is the suspension of one executing task so another task can run.
- How it is used
- Applies task priorities and scheduling to meet embedded real-time deadlines.
- How deep it goes
- Connects preemption to priorities and deadlines but stops short of specifying a scheduler implementation.
- Examples
- Illustrates a higher-priority task pausing and replacing a running lower-priority task.
- What you can do after
- Evaluate how priority-based task interruption supports temporal correctness and deadline satisfaction.
Kubernetes for Developers
Preemption is the proactive removal of lower-priority Pods to make resources available for higher-priority Pods.
- How it is used
- Uses priority-based displacement to schedule important workloads during temporary cluster capacity shortages.
- How deep it goes
- Explains PriorityClass configuration, scheduling effects, rescheduling behavior, and placeholder capacity, but not detailed eviction algorithms.
- Examples
- Uses high-priority Deployments, non-preempting PriorityClasses, and low-priority placeholder Deployments to demonstrate displacement.
- What you can do after
- Configure preemptive and non-preemptive PriorityClasses and operate placeholder Deployments for rapid scheduling headroom.
100 Go Mistakes and How to Avoid Them
Preemptive scheduling is a scheduling model in which the scheduler can interrupt an executing task and replace it with another task.
- How it is used
- Explains how Go shares CPU time among goroutines and keeps long-running work from monopolizing execution.
- How deep it goes
- Defines preemption, contrasts it with cooperative scheduling, and gives an approximate 10 ms threshold without detailing runtime internals.
- Examples
- Uses long-running work, parallel merge sort, runnable queues, and a four-core goroutine-state diagram.
- What you can do after
- Evaluate whether CPU-bound goroutines can share execution without explicit blocking operations.
Read how 100 Go Mistakes and How to Avoid Them explains preemption →
Elixir in Action, Third Edition
Preemptive scheduling is a scheduling method that interrupts running processes to switch execution to other runnable processes.
- How it is used
- Maintains responsiveness by preventing long-running Erlang processes from monopolizing execution.
- How deep it goes
- Explains execution windows, pauses, context switches, and load behavior without detailing scheduler implementation internals.
- Examples
- Illustrates long-running processes, waiting I/O operations, rising request load, and the Erlang virtual machine.
- What you can do after
- Evaluate/understand how BEAM scheduling limits blocking and shapes performance under increasing load.
Read how Elixir in Action, Third Edition explains preemption →
Python Concurrency with asyncio
Preemptive multitasking is a scheduling technique in which the system forcibly pauses running tasks according to its scheduling policy.
- How it is used
- Frames operating-system scheduling as a way to run multiple tasks concurrently through time slicing.
- How deep it goes
- Defines time slicing and contrasts cooperative scheduling, but defers operating-system internals.
- Examples
- Demonstrates scheduling with ProcessPoolExecutor tasks that count to several small values and one large value.
- What you can do after
- Evaluate whether concurrent work is concurrent only or also parallel, and recognize process- and thread-based implementations.
Read how Python Concurrency with asyncio explains preemption →
Also covered in
- Acing the CCNA Exam: Volume 1 Fundamentals and Protocols
- Fast Python: High performance techniques for large datasets
- Distributed Machine Learning Patterns
- Learn Concurrent Programming with Go
What to know first
- CPUA central processing unit (CPU) is a computer processor that executes program instructions and performs general-purpose computational operations.
- threadA thread is a distinct sequence of execution with its own control flow and state, managed or scheduled by a processor, runtime, or operating system.
- workflowA workflow is an organized sequence of coordinated activities or tasks through which work progresses toward a defined outcome.
- concurrencyConcurrency is the structuring or execution of multiple computational activities so their progress overlaps in time, whether or not they run simultaneously.
Related concepts
- cooperative multitaskingalternative to · Cooperative multitasking is a scheduling technique in which executing tasks voluntarily yield control at defined points so other tasks can run.
- multitaskingkind of · Multitasking is the concurrent or apparently concurrent management of multiple tasks by sharing, interleaving, or switching among execution resources.
- scheduleruses · A scheduler is a software component that selects, orders, or dispatches tasks for execution and may assign them execution resources according to defined policies or constraints.
- failureaddresses · A failure is an event or condition in which an operation, component, or system does not achieve an expected result or perform its intended function.
Questions about preemption
What is preemption?
Preemption is the interruption or displacement of active execution or resource allocation so another eligible activity can proceed.
Which Manning books explain preemption?
Grokking Concurrency, Robotics for Programmers, Kubernetes for Developers, 100 Go Mistakes and How to Avoid Them, Elixir in Action, Third Edition and Python Concurrency with asyncio.
What should I know before learning preemption?
Manning books that teach preemption usually introduce CPU, thread, workflow and concurrency first.
What is the difference between preemption and cooperative multitasking?
Preemption is the interruption or displacement of active execution or resource allocation so another eligible activity can proceed. Cooperative multitasking is a scheduling technique in which executing tasks voluntarily yield control at defined points so other tasks can run.
What is preemption a kind of?
Preemption is a kind of multitasking. Multitasking is the concurrent or apparently concurrent management of multiple tasks by sharing, interleaving, or switching among execution resources.
What is preemption also called?
Preemption is also called preemptive.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.





