Boost application performance using asynchronous I/O-ref
The request for? .../ Prepare the first aiocb / ... bzero( (char *)list,sizeof(list) ); ret = lio_listio( LIO_WAIT,list,NULL ); The read operation is noted in the?
Now that you've seen the AIO functions that are available,this section digs into the methods that you can use for asynchronous notification. I'll explore asynchronous notification through signals and function callbacks. The use of signals for interprocess communication (IPC) is a traditional mechanism in UNIX and is also supported by AIO. In this paradigm,the application defines a signal handler that is invoked when a specified signal occurs. The application then specifies that an asynchronous request will raise a signal when the request has completed. As part of the signal context,the particular?
/ Set up the signal handler / / Set up the AIO request / / Link the AIO request with the Signal Handler / / Map the Signal to the Signal Handler / ... ret = aio_read( &my_aiocb ); } void aio_completion_handler( int signo,siginfo_t info,void context ) / Ensure it's our signal /
} return; In Listing 5,you set up your signal handler to catch the? For performance,the completion handler is an ideal spot to continue the I/O by requesting the next asynchronous transfer. In this way,when completion of one transfer has completed,you immediately start the next. An alternative notification mechanism is the system callback. Instead of raising a signal for notification,this mechanism calls a function in user-space for notification. You initialize the?
(编辑:ASP站长) 【免责声明】本站内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。 |
-
无相关信息