Go to the first, previous, next, last section, table of contents.


How to optimize the AIO implementation

The POSIX standard does not specify how the AIO functions are implemented. They could be system calls but it is also possible to emulate them at userlevel.

At least the available implementation at the point of this writing is a userlevel implementation which uses threads for handling the enqueued requests. This implementation requires to make some decisions about limitations but hard limitations are something which better should be avoided the GNU C library implementation provides a mean to tune the AIO implementation individually for each use.

Data Type: struct aioinit
This data type is used to pass the configuration or tunable parameters to the implementation. The program has to initialize the members of this struct and pass it to the implementation using the aio_init function.

int aio_threads
This member specifies the maximal number of threads which must be used at any one time.
int aio_num
This number provides an estimate on the maximal number of simultaneously enqueued requests.
int aio_locks
int aio_usedba
int aio_debug
int aio_numusers
int aio_reserved[2]

Function: void aio_init (const struct aioinit *init)
This function must be called before any other AIO function. Calling it is completely voluntarily since it only is meant to help the AIO implementation to perform better.

Before calling the aio_init function the members of a variable of type struct aioinit must be initialized. Then a reference to this variable is passed as the parameter to aio_init which itself may or may not pay attention to the hints.

The function has no return value and no error cases are defined. It is a extension which follows a proposal from the SGI implementation in Irix 6. It is not covered by POSIX.1b or Unix98.


Go to the first, previous, next, last section, table of contents.