Skip to content

Commit 449843b

Browse files
committed
update async I/O
1 parent 8ab852e commit 449843b

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

docs/socket/async.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
此处所说的异步 I/O 模型指的是 UNIX 规范中所描述的通用异步 I/O 机制。区别于信号驱动式的 I/O 模型,此种模型是真正的异步 I/O 实现。这种模型与信号驱动模型的主要区别在于:信号驱动 I/O 是由内核通知应用程序何时启动一个 I/O 操作,而异步 I/O 模型是由内核通知应用程序 I/O 操作何时完成。目前 Linux 中有三种异步 I/O 模式,分别如下
44

5-
- [glibc](https://archlinux.org/packages/core/x86_64/glibc/)在用户空间供了以 aio\_为前缀的一系列函数,通过 pthread 多线程的方式以模拟的形式来实现异步 I/O 模型,从而不依赖于内核。
6-
- [libaio](https://archlinux.org/packages/core/x86_64/libaio/)函数库提供了对于内核异步 I/O 的调用方式,其为一个 POSIX 规范在 Linux 下的实现。
7-
- kernel 5.X 时代的异步模型 io_uring,相应的库为[liburing](https://archlinux.org/packages/extra/x86_64/liburing/)
5+
- [glibc](https://archlinux.org/packages/core/x86_64/glibc/)在用户空间供了以 aio\_为前缀的一系列函数,通过 pthread 多线程的方式以模拟的形式来实现异步 I/O 模型,从而不依赖于内核。对应头文件为 aio.h。
6+
- [libaio](https://archlinux.org/packages/core/x86_64/libaio/)函数库提供了对于内核异步 I/O 的调用方式,其为一个 POSIX 规范在 Linux 下的实现。对应头文件为 libaio.h。
7+
- kernel 5.X 时代的异步模型 io_uring,原生 io_uring 接口相对应的库为[liburing](https://archlinux.org/packages/extra/x86_64/liburing/)
88

99
然而前两种模式均不支持在套接字方面的应用,并且并没有被广泛应用和采纳,而且它们已经逐渐被新的 io_uring 模式取代,所以本文不再描述这两种模式。
1010

@@ -13,4 +13,7 @@ io_uring 是 linux 内核 5.X 时代加入的全新异步 I/O 模型,大概在
1313
---
1414

1515
Ref:
16-
[[2]](http://www.mathcs.emory.edu/~cheung/Courses/455/Syllabus/9-netw-prog/timeout6.html)
16+
17+
https://github.com/shuveb/io_uring-by-example
18+
https://github.com/frevib/io_uring-echo-server
19+
http://www.mathcs.emory.edu/~cheung/Courses/455/Syllabus/9-netw-prog/timeout6.html)

docs/socket/basic.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Socket 编程是完成一个能够突破互联网封锁的软件的基础内容
1111
- [网络编程必备知识:图解 Socket 核心内幕以及五大 IO 模型 | 阻塞 IO,非阻塞 IO,IO 复用,信号驱动式 IO,异步 IO](https://www.itzhai.com/articles/necessary-knowledge-of-network-programming-graphic-socket-core-insider-and-five-io-models.html)
1212
- [似乎没那么完美的信号驱动式 IO](https://www.itzhai.com/articles/it-seems-not-so-perfect-signal-driven-io.html)
1313
- [彻底弄懂 IO 复用:IO 处理杀手锏,带您深入了解 select,poll,epoll](https://www.itzhai.com/articles/thoroughly-understand-io-reuse-take-you-in-depth-understanding-of-select-poll-epoll.html)
14+
- [ 异步 IO:新时代的 IO 处理利器 | aio,io_uring,IOCP ](https://www.itzhai.com/articles/asynchronous-programming-a-new-era-of-io-processing-weapon.html)
1415
- Linux/Unix 系统编程手册
1516
- UNIX 网络编程
1617
- UNIX 环境高级编程

0 commit comments

Comments
 (0)