liveBook · Manning

I/O-bound work

As explained in Rust Servers, Services, and Apps

An I/O-bound program is a program whose progress rate is primarily limited by the speed of input and output operations.

I/O-bound work is work whose progress primarily depends on the speed of an input/output subsystem rather than the CPU. File access, database access, and network TCP/HTTP requests are typical cases. section 10.1 section 10.3

While a task waits for a disk, network socket, or timer, an asynchronous runtime such as Tokio can schedule another asynchronous task. When the external operation completes, the waiting task resumes. section 10.3

Recognize I/O-bound work through its external waits:

Concurrent file reads with Tokio

Two file-reading futures can be spawned and joined. Each task waits independently, allowing the runtime to process the other task instead of leaving the processor idle. The sample output shows file 2 completing before file 1, despite both tasks starting together. section 10.3

Figure 10.4 Async programming in HTTP request processing

Use the HTTP request-processing diagram to compare asynchronous handling of I/O waits with thread-per-connection processing. section 10.1

I/O-bound work is a candidate for asynchronous execution, but the guideline is broad and has exceptions. CPU-bound work, such as complex number-crunching, is limited by processor speed instead. section 10.3

How Rust Servers, Services, and Apps covers it

How deep it goes
Defines the bottleneck, contrasts CPU-bound work, and demonstrates runtime scheduling without fully developing asynchronous internals.
Examples
Uses file reads, database access, TCP/HTTP requests, timers, and two Tokio-spawned file futures as examples.
What it assumes
Assumes familiarity with programs and processors while distinguishing CPU-intensive and I/O-intensive work through concrete examples.
What you can do after
Evaluate whether asynchronous task execution fits workloads whose progress depends on file, database, network, or timer operations.
How it connects
Connects I/O-bound work with asynchronous programming, concurrency, parallel processing, multithreading, CPU-bound work, and async runtimes.

Also explained in

Compare how 5 books explain I/O-bound work →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Rust Servers, Services, and Apps. The section links point to the parts of the book it draws on.