六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 27|回复: 0

同步、异步IO

[复制链接]

升级  50%

33

主题

33

主题

33

主题

秀才

Rank: 2

积分
125
 楼主| 发表于 2013-1-28 17:42:27 | 显示全部楼层 |阅读模式
参考中文篇
http://blog.csdn.net/historyasamirror/article/details/5778378
 
 
Introduction to AIO
Linux asynchronous I/O is a relatively recent addition to the Linux kernel. It's a standard feature of the 2.6 kernel, but you can find patches for 2.4. The basic idea behind AIO is to allow a process to initiate a number of I/O operations without having to block or wait for any to complete. At some later time, or after being notified of I/O completion, the process can retrieve the results of the I/O.
I/O models
Before digging into the AIO API, let's explore the different I/O models that are available under Linux. This isn't intended as an exhaustive review, but rather aims to cover the most common models to illustrate their differences from asynchronous I/O. Figure 1 shows synchronous and asynchronous models, as well as blocking and non-blocking models.

Figure 1. Simplified matrix of basic Linux I/O models

Each of these I/O models has usage patterns that are advantageous for particular applications. This section briefly explores each one.
Synchronous blocking I/O
<div class="ibm-container ibm-alt-header dw-container-sidebar">I/O-bound versus CPU-bound processes

<div class="ibm-container-body">A process that is I/O bound is one that performs more I/O than processing. A CPU-bound process does more processing than I/O. The Linux 2.6 scheduler actually favors I/O-bound processes because they commonly initiate an I/O and then block, which means other work can be efficiently interlaced between them.
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表