同步、异步IO
参考中文篇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
http://www.ibm.com/developerworks/linux/library/l-async/figure1.gif
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.
页:
[1]