HP-UX 11i v3 September 2012 Release Notes

12 Other functionality
This chapter covers additional applications or functionality in the Operating Environments. For
changes to other products and features related to this chapter, see “What is new in the HP-UX 11i
v3 September 2012 release (page 13).
AioEnh
POSIX AIO provides a mechanism to wait for the completion of multiple Asynchronous I/O (AIO)
requests through a system call, aio_reap(2).
Without this new functionality, if aio_reap(2) has been called to reap the AIO requests when there
are no outstanding requests, or when the outstanding requests are less than what has been asked
to reap, aio_reap(2) fails with E2BIG error. This behavior of failing the aio_reap(2) causes a
concern in some multi-threaded environments, where multiple calls to aio_reap(2) to reap the
request is costlier than allowing a single aio_reap(2) to reap all the requested number of I/Os by
waiting until there are new AIO requests queued to the process or until the timeout specified to
aio_reap(2) expires.
AioEnh delivers the POSIX AIO functionality wherein aio_reap(2) has been modified to wait for
the outstanding AIO requests to become equal to the specified number of AIO requests, when the
outstanding AIO requests are less than the number of I/O requests that aio_reap(2) has been asked
to reap.
Summary of Change
The aio_reap(2) system call has been updated to reflect the new behavior. To use aio_reap(2),
the reap mechanism must be initiated by making a light-weight polling call to aio_reap(2). This
call must be made before calling any other AIO functions. To enable this new behavior aio_reap(2)
must be called in lightweight mode as shown in the following example:
int aio_init_val = 0xEAF1;
(void)aio_reap(NULL, 0, NULL, 0, &aio_init_val);
The magic number 0xEAF1 should be passed to the last argument of aio_reap(2) in lightweight
polling mode. The new functionality is enabled per process, meaning that only the process that
initializes the reap mechanism will get the new functionality enabled (as shown above). Once the
new functionality is enabled, it can not be disabled for that particular process instance.
Compatibility
There are no known compatibility issues.
Performance
There are no known performance issues.
Documentation
Product website
https://h20392.www2.hp.com/portal/swdepot/displayProductInfo.do?
productNumber=AioEnh
Obsolescence
Not applicable.
124 Other functionality