Fundamentals 8 min read

Linux I/O Models: Blocking, Non‑Blocking, Multiplexing, Signal‑Driven, Async

This article introduces the five Linux I/O models—blocking, non‑blocking, I/O multiplexing, signal‑driven, and asynchronous—explaining core concepts such as blocking vs non‑blocking calls, synchronous vs asynchronous processing, and detailing each model’s execution phases, advantages, and typical use‑cases.

Liangxu Linux
Liangxu Linux
Liangxu Linux
Linux I/O Models: Blocking, Non‑Blocking, Multiplexing, Signal‑Driven, Async

Basic Concepts

Blocking – the calling thread is suspended until the operation completes; the CPU does not schedule the thread during this period.

Non‑Blocking – the call returns immediately if the result is not ready, allowing the thread to continue while the kernel will later notify readiness.

Synchronous – the caller waits for the operation to finish before proceeding; logically this is a blocking behavior.

Asynchronous – the operation proceeds independently; the kernel notifies the caller via callbacks, signals, or other mechanisms once the data is ready.

Blocking I/O

When a process issues a read/write system call, the kernel first prepares the data in its internal buffer. Only after the data has been copied from the kernel buffer to the user‑space buffer does the kernel unblock the process, allowing it to resume execution.

Blocking I/O flow
Blocking I/O flow

Non‑Blocking I/O

This model separates the operation into two phases:

Waiting phase – the process repeatedly polls the kernel (e.g., via read() returning EAGAIN ) without being blocked.

Data‑copy phase – once the kernel has the data ready, it blocks the process briefly to copy the data to user space.

Non‑Blocking I/O flow
Non‑Blocking I/O flow

I/O Multiplexing

Multiplexing adds a monitoring call such as select(), poll() or epoll(). The kernel blocks the calling thread inside this call until at least one monitored file descriptor becomes ready. After readiness is reported, the application performs the actual data copy. This reduces CPU waste compared with continuous polling in pure non‑blocking mode.

I/O multiplexing flow
I/O multiplexing flow

Signal‑Driven I/O

The kernel prepares data without blocking the process. When the data is ready, it sends a signal (or invokes a callback) to the process. The notification can be:

Level‑triggered – the kernel keeps sending the signal until the process handles it.

Edge‑triggered – the kernel sends the signal only once when the state changes.

After notification, the process enters the data‑copy phase, during which it is blocked while the kernel copies the data to user space.

Signal‑Driven I/O flow
Signal‑Driven I/O flow

Asynchronous I/O

The process initiates the I/O operation (e.g., via io_submit() or aio_read()) and immediately continues with other work. The kernel performs both the preparation and the data‑copy phases without ever blocking the user thread. When the operation completes, the kernel places the data in a designated buffer and notifies the process (e.g., via an eventfd, signal, or completion queue). The application then retrieves the data at its convenience.

Asynchronous I/O flow
Asynchronous I/O flow

Comparison

Blocking vs. non‑blocking I/O differs in whether the process is suspended during the data‑preparation phase.

Synchronous vs. asynchronous I/O differs in whether the process is blocked during the data‑copy phase.

Performance (from lowest to highest efficiency): Blocking < Non‑Blocking < I/O Multiplexing < Signal‑Driven < Asynchronous. Only the asynchronous model is truly asynchronous; the others are synchronous at the kernel level.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

I/OLinuxOperating SystemsAsyncMultiplexingNon-blockingBlocking
Liangxu Linux
Written by

Liangxu Linux

Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.