Boost application performance using asynchronous I/O-ref
Finally,the asynchronous non-blocking I/O model is one of overlapping processing with I/O. The read request returns immediately,indicating that the? The ability to overlap computation and I/O processing in a single process for potentially multiple I/O requests exploits the gap between processing speed and I/O speed. While one or more slow I/O requests are pending,the CPU can perform other tasks or,more commonly,operate on already completed I/Os while other I/Os are initiated.The next section examines this model further,explores the API,and then demonstrates a number of the commands.
From the previous taxonomy of I/O models,you can see the motivation for AIO. The blocking models require the initiating application to block when the I/O has started. This means that it isn't possible to overlap processing and I/O at the same time. The synchronous non-blocking model allows overlap of processing and I/O,but it requires that the application check the status of the I/O on a recurring basis. This leaves asynchronous non-blocking I/O,which permits overlap of processing and I/O,including notification of I/O completion. The functionality provided by the?
This section explores the asynchronous I/O model for Linux to help you understand how to apply it in your applications. In a traditional I/O model,there is an I/O channel that is identified by a unique handle. In UNIX?,these are file descriptors (which are the same for files,pipes,sockets,and so on). In blocking I/O,you initiate a transfer and the system call returns when it's complete or an error has occurred. AIO first entered the Linux kernel in 2.5 and is now a standard feature of 2.6 production kernels. In asynchronous non-blocking I/O,you have the ability to initiate multiple transfers at the same time. This requires a unique context for each transfer so you can identify it when it completes. In AIO,this is an?
The AIO interface API is quite simple,but it provides the necessary functions for data transfer with a couple of different notification models. Table 1 shows the AIO interface functions,which are further explained later in this section.
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |