加入收藏 | 设为首页 | 会员中心 | 我要投稿 网站开发网_马鞍山站长网 (https://www.0555zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长百科 > 正文

Boost application performance using asynchronous I/O-ref

发布时间:2021-01-29 10:10:05 所属栏目:站长百科 来源:网络整理
导读:副标题#e# 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

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.

API function aio_readaio_erroraio_returnaio_writeaio_suspendaio_cancellio_listio Each of these API functions uses the?aiocb?structure for initiating or checking. This structure has a number of elements,but Listing 1 shows only the ones that you'll need to (or can) use.

int aio_fildes; // File Descriptor
int aio_lio_opcode; // Valid only for lio_listio (r/w/nop)
volatile void *aio_buf; // Data Buffer
size_t aio_nbytes; // Number of Bytes in Data Buffer
struct sigevent aio_sigevent; // Notification Structure

/ Internal fields /
...

};

(编辑:网站开发网_马鞍山站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

Description