Blocking
Blocking is execution behavior in which an operation or execution path cannot make progress until a required event, condition, resource, or other operation is available or complete.
Python Concurrency with asyncio
A socket operating mode in which an application waits for an I/O operation to complete before continuing.
- How it is used
- Diagnoses why synchronous applications, socket servers, and asyncio tasks become unresponsive during slow I/O.
- How deep it goes
- Explains blocking from application behavior through socket calls and event-loop effects, then defers implementation to non-blocking libraries and threads.
- Examples
- Demonstrates frozen applications, a two-client echo server, requests.get, time.sleep, aiohttp, and sync_to_async.
- What you can do after
- Diagnose blocking calls and choose non-blocking libraries or thread-based bridges for responsive asynchronous applications.
Read how Python Concurrency with asyncio explains blocking →
Rust Servers, Services, and Apps
A blocking operation is an operation that prevents its executing thread or task from continuing until an external activity completes.
- How it is used
- Motivates choosing synchronous execution, operating system threads, or async scheduling for tasks that wait on external work.
- How deep it goes
- Defines blocking through thread waits and works through simulated delays and threaded code; does not examine operating system I/O internals.
- Examples
- Uses sequential simulated file reads with four- and two-second sleeps, then runs them on separate operating system threads.
- What you can do after
- Diagnose/debug with it by identifying waits that hold up a thread and comparing sequential execution with separate-thread execution.
Read how Rust Servers, Services, and Apps explains blocking →
C# Concurrency: Asynchronous and multithreaded programming
A blocking operation is an operation that prevents its thread from making progress while waiting for external data, another thread, or another condition.
- How it is used
- Explains why waiting on files, networks, and threads consumes resources and motivates asynchronous programming.
- How deep it goes
- Defines operating-system blocking, thread costs, and thread-pool effects, then stops short of low-level implementation details.
- Examples
- Uses file and network access, camera capture, mail sending, Task.Wait, Task.Result, Task.Delay, and thread-pool benchmarks.
- What you can do after
- Diagnose blocked threads and choose asynchronous APIs when workloads spend most of their time waiting.
Read how C# Concurrency: Asynchronous and multithreaded programming explains blocking →
Grokking Concurrency
Blocking is a condition in which a task or operation cannot make progress until a required event, resource, or I/O operation completes.
- How it is used
- Explains how waiting operations affect processor use, concurrent tasks, and server responsiveness.
- How deep it goes
- Defines blocking I/O and distinguishes it from synchronous control flow, without detailing all four I/O models.
- Examples
- Uses waiting for pizza to cook and socket calls such as send() and recv() as examples.
- What you can do after
- Understand why blocking I/O can leave a processor idle or make an event loop unresponsive.
Quarkus in Action
A blocking operation is an operation that prevents its executing thread from performing other work until the operation completes.
- How it is used
- Frames blocking as a practical constraint when integrating I/O and message handlers with reactive Quarkus applications.
- How deep it goes
- Explains thread occupancy, event-loop consequences, warnings, and channel or annotation-based mitigation without detailing scheduler internals.
- Examples
- Uses database, filesystem, network, and broker I/O plus a sleeping payment consumer as concrete blocking examples.
- What you can do after
- Apply it via Quarkus messaging by isolating waiting work on a channel and annotating the handler with @Blocking.
Code Like a Pro in Rust
A blocking operation is an operation that prevents an asynchronous runtime from switching tasks for a significant period.
- How it is used
- Uses blocking to distinguish work that prevents an async scheduler from switching tasks from work that yields during waits.
- How deep it goes
- Defines blocking and yield points, explains I/O and CPU-bound causes, and leaves the duration threshold context-dependent.
- Examples
- Contrasts thread sleep with an awaited Tokio timer and estimates the cost of a 50-instruction operation.
- What you can do after
- Apply a nonblocking timer via Tokio and recognize when long-running work may prevent task switching.
Refactoring to Rust
Blocking is execution behavior in which a process cannot proceed until a required resource or operation becomes available.
- How it is used
- Uses blocking to identify synchronous bottlenecks in image generation and data requests before introducing asynchronous processing.
- How deep it goes
- Defines blocking through process and request waiting, then contrasts it with asynchronous processing without explaining scheduler internals.
- Examples
- Uses a Python Mandelbrot image loop, concurrent process commands, and an asynchronous Rust search request as concrete examples.
- What you can do after
- Diagnose synchronous waits and choose asynchronous processing when independent work should continue without waiting for responses.
Go in Action, Second Edition
A blocking I/O operation prevents the calling execution flow from progressing until input or output completes.
- How it is used
- Uses blocking network waits to motivate concurrency for independent feed retrieval and responsive applications.
- How deep it goes
- Demonstrates synchronous ParseURL calls and moves them into goroutines, without detailing blocking internals or synchronization mechanisms.
- Examples
- Uses New York Times and BBC RSS requests parsed through gofeed.ParseURL.
- What you can do after
- Apply it via Go goroutines to overlap independent network or disk waits with other work.
Akka in Action, Second Edition
Blocking I/O is input or output whose calling execution path waits until the operation completes or fails.
- How it is used
- Frames blocking I/O as a traditional scaling mechanism whose synchronous waits complicate thread, RPC, and database coordination.
- How deep it goes
- Explains blocking I/O through database drivers, RPCs, lock interactions, and access-flow risks, but stops short of implementation internals.
- Examples
- Uses JDBC, DAO calls, and a team-chat message flow to illustrate blocking database access.
- What you can do after
- Evaluate how synchronous database calls and RPCs can create coordination, deadlock, and scaling risks.
Test Driven: Practical TDD and Acceptance TDD for Java Developers
Blocking behavior occurs when an operation waits for a condition or event before proceeding.
- How it is used
- Tests whether a method waits for a required event and whether interruption can release it.
- How deep it goes
- Demonstrates a threaded test using a return flag, a delay, interruption and completion checks.
- Examples
- Uses a black-market ticket method that waits until a ticket is sold.
- What you can do after
- Apply it with Java threads to test whether a method blocks and responds to interruption.
Read how Test Driven: Practical TDD and Acceptance TDD for Java Developers explains blocking →
Also covered in
- Latency
- Learn SQL in a Month of Lunches
- Logs and Telemetry
- Fast Python: High performance techniques for large datasets
- C++ Concurrency in Action, Second Edition
- Think Distributed Systems
- Grokking Software ArchitectureIn early access (MEAP)
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.
- serverA server is a computer system or software process that provides data, resources, or services to other systems, typically by responding to requests.
- thread poolA thread pool is a managed collection of reusable worker threads that execute submitted tasks, typically avoiding the creation of a new thread for each task.
- CPUA central processing unit (CPU) is a computer processor that executes program instructions and performs general-purpose computational operations.
Related concepts
- threaduses · A thread is a distinct sequence of execution with its own control flow and state, managed or scheduled by a processor, runtime, or operating system.
- asynchronous programmingcontrasts with · Asynchronous programming structures operations so that the initiating execution can continue or yield control without synchronously waiting for each operation to complete.
- non-blocking I/Ocontrasts with · Non-blocking I/O is an input/output technique that lets the initiating execution continue without waiting for the I/O operation to complete.
- multithreadingaddressed by · Multithreading is the execution of multiple threads of control within a program, concurrently through interleaving or simultaneously.
- answer criticincludes · An answer critic is a component that evaluates whether a retrieved answer correctly and completely answers the original question and can prevent unsupported answers from being returned.
Questions about blocking
What is blocking?
Blocking is execution behavior in which an operation or execution path cannot make progress until a required event, condition, resource, or other operation is available or complete.
Which Manning books explain blocking?
Python Concurrency with asyncio, Rust Servers, Services, and Apps, C# Concurrency: Asynchronous and multithreaded programming, Grokking Concurrency, Quarkus in Action, Code Like a Pro in Rust, Refactoring to Rust, Go in Action, Second Edition and 2 more.
What should I know before learning blocking?
Manning books that teach blocking usually introduce thread, server, thread pool and CPU first.
What is the difference between blocking and Thread.getState?
Blocking is execution behavior in which an operation or execution path cannot make progress until a required event, condition, resource, or other operation is available or complete. Thread.getState is a Java method that returns the state of a thread at the time of the call.
What kinds of blocking are there?
Kinds of blocking include answer critic.
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.









