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 →
Secrets of the JavaScript Ninja, Third Edition
Single-threaded execution means JavaScript code executes in one thread of control at a time.
- How it is used
- Processes browser events one at a time, providing the execution model for event-handler work.
- How deep it goes
- Defines single-threaded execution and outlines event-queue processing; defers detailed event-loop behavior.
- Examples
- Uses a one-teller bank line analogy and cites clicks, key presses, and fetch events.
- What you can do after
- Diagnose why lengthy event handlers leave web applications unresponsive by tracing queued events waiting their turn.
Read how Secrets of the JavaScript Ninja, Third Edition explains single-threaded execution model →
Also covered in
What to know first
- 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.
- resourceA resource is an identifiable asset, entity, or capability that a system or activity can access, use, allocate, or manage.
Related concepts
- execution modelkind of · An execution model is an abstract set of rules describing how a computational system organizes, triggers, orders, and carries out computations.
- interleavingaddresses · Interleaving is the combination of actions or elements from multiple sequences while preserving the relative order within each sequence.
- JavaScriptused by · JavaScript is a high-level, dynamically typed programming language standardized as ECMAScript and used for web and general-purpose programming.
- 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 timing or ordering of interacting operations.
- event handlingconfigures · Event handling is the process of receiving events and invoking associated code to respond to them.
Questions about single-threaded execution model
What is 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.
Which Manning books explain single-threaded execution model?
Python Concurrency with asyncio, Grokking Simplicity and Secrets of the JavaScript Ninja, Third Edition.
What should I know before learning single-threaded execution model?
Manning books that teach single-threaded execution model usually introduce thread and resource first.
What is single-threaded execution model a kind of?
Single-threaded execution model is a kind of execution model. An execution model is an abstract set of rules describing how a computational system organizes, triggers, orders, and carries out computations.
What is single-threaded execution model also called?
Single-threaded execution model is also called single-threaded model.
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.


