NAME
aio_init - How to optimize the AIO implementation
SYNOPSYS
#include <errno.h>
#include <aio.h>
void aio_init (const struct aioinit *init)
DESCRIPTION
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 the point of this writing, the available implementation is a
userlevel implementation which uses threads for handling the enqueued
requests. While this implementation requires making some decisions
about limitations, hard limitations are something which is best avoided
in the GNU C library. Therefore, the GNU C library provides a means
for tuning the AIO implementation according to the individual use.
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 may 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
Unused.
int aio_usedba
Unused.
int aio_debug
Unused.
int aio_numusers
Unused.
int aio_reserved[2]
Unused.
This function must be called before any other AIO function. Calling it
is completely voluntary, as it is only meant to help the AIO
implementation 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.
It is a extension which follows a proposal from the SGI implementation
in Irix 6. It is not covered by POSIX.1b or Unix98.
RETURN VALUES
The function has no return value.
ERRORS
The function has no error cases defined.
SEE ALSO
aio(3), aio_cancel(3), aio_cancel64(3), aio_error(3), aio_error64(3),
aio_fsync(3), aio_fsync64(3), aio_read(3), aio_read64(3),
aio_return(3), aio_return64(3), aio_suspend(3), aio_suspend64(3),
aio_write(3), aio_write64(3), errno(3).