Single-threaded execution model
A single-threaded execution model runs program work on one thread of control at a time, potentially interleaving progress among tasks.
Python Concurrency with asyncio
A single-threaded concurrency model is a concurrency design in which one thread interleaves progress among multiple tasks.
- How it is used
- Deploys one event-loop thread to overlap non-blocking I/O tasks in asyncio applications.
- How deep it goes
- Explains task scheduling, CPU-bound blocking, and await-related races, while deferring process-pool execution details.
- Examples
- Uses CPU-bound counting loops, delay tasks, shared counters, socket dictionaries, echo servers, and asyncio locks.
- What you can do after
- Apply it via asyncio to overlap I/O tasks, recognize event-loop blocking, and protect suspended shared-state workflows.
Read how Python Concurrency with asyncio explains single-threaded execution model →
Grokking Simplicity
A single-threaded runtime is an execution environment in which program actions execute on one thread at a time.
- How it is used
- Simplifies browser JavaScript timelines and supports reasoning about asynchronous callbacks, shared resources, and coordination.
- How deep it goes
- Defines event-loop execution, simplifies timeline diagrams, and implements coordination, but does not eliminate asynchronous ordering problems.
- Examples
- Uses dinner actions, browser events, add-to-cart callbacks, timeline diagrams, and a Cut completion counter.
- What you can do after
- Diagnose asynchronous ordering issues and coordinate shared work using JavaScript’s sequential callback execution.
Read how Grokking Simplicity explains single-threaded execution model →
Related concepts
- JavaScriptused by · JavaScript is a high-level, dynamically typed, multi-paradigm programming language standardized as ECMAScript and used for web and general-purpose programming.
- interleavingaddresses · Interleaving is the combination of actions or elements from multiple sequences while preserving the relative order within each sequence.
- asyncioused by · asyncio is Python’s standard-library framework for asynchronous programming, built around coroutines, awaitable objects, and event loops.
- race conditionaddresses · A race condition is a concurrency defect in which program behavior or results depend on the relative timing or ordering of interacting operations.
- event handlingconfigures · Event handling is the process of receiving events and invoking associated code to respond to them.
- multithreadingcontrasts with · Multithreading is a concurrency technique in which multiple threads of execution operate within a program or process, with their work interleaved or running in parallel.
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.

