1AIO_INIT(3) Linux Programmer's Manual AIO_INIT(3)
2
3
4
6 aio_init - asynchronous I/O initialization
7
9 #define _GNU_SOURCE /* See feature_test_macros(7) */
10 #include <aio.h>
11
12 void aio_init(const struct aioinit *init);
13
14 Link with -lrt.
15
17 The GNU-specific aio_init() function allows the caller to provide tun‐
18 ing hints to the glibc POSIX AIO implementation. Use of this function
19 is optional, but to be effective, it must be called before employing
20 any other functions in the POSIX AIO API.
21
22 The tuning information is provided in the buffer pointed to by the
23 argument init. This buffer is a structure of the following form:
24
25 struct aioinit {
26 int aio_threads; /* Maximum number of threads */
27 int aio_num; /* Number of expected simultaneous
28 requests */
29 int aio_locks; /* Not used */
30 int aio_usedba; /* Not used */
31 int aio_debug; /* Not used */
32 int aio_numusers; /* Not used */
33 int aio_idle_time; /* Number of seconds before idle thread
34 terminates (since glibc 2.2) */
35 int aio_reserved;
36 };
37
38 The following fields are used in the aioinit structure:
39
40 aio_threads This field specifies the maximum number of worker
41 threads that may be used by the implementation. If the
42 number of outstanding I/O operations exceeds this limit,
43 then excess operations will be queued until a worker
44 thread becomes free. If this field is specified with a
45 value less than 1, the value 1 is used. The default
46 value is 20.
47
48 aio_num This field should specify the maximum number of simulta‐
49 neous I/O requests that the caller expects to enqueue.
50 If a value less than 32 is specified for this field, it
51 is rounded up to 32. The default value is 64.
52
53 aio_idle_time This field specifies the amount of time in seconds that
54 a worker thread should wait for further requests before
55 terminating, after having completed a previous request.
56 The default value is 1.
57
59 The aio_init() function is available since glibc 2.1.
60
62 This function is a GNU extension.
63
65 aio(7)
66
68 This page is part of release 4.15 of the Linux man-pages project. A
69 description of the project, information about reporting bugs, and the
70 latest version of this page, can be found at
71 https://www.kernel.org/doc/man-pages/.
72
73
74
75Linux 2017-09-15 AIO_INIT(3)