proc.5: Refer to split-out manual pages for detailed description
[man-pages.git] / man3 / aio_init.3
blob79d36f2a5ad82388776b12b713dc8f5c93ea8f97
1 .\" Copyright (c) 2010 by Michael Kerrisk <mtk.manpages@gmail.com>
2 .\"
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
4 .\"
5 .TH aio_init 3 (date) "Linux man-pages (unreleased)"
6 .SH NAME
7 aio_init \- asynchronous I/O initialization
8 .SH LIBRARY
9 Real-time library
10 .RI ( librt ", " \-lrt )
11 .SH SYNOPSIS
12 .nf
13 .BR "#define _GNU_SOURCE" "         /* See feature_test_macros(7) */"
14 .B "#include <aio.h>"
16 .BI "void aio_init(const struct aioinit *" init );
17 .fi
18 .SH DESCRIPTION
19 The GNU-specific
20 .BR aio_init ()
21 function allows the caller to provide tuning hints to the
22 glibc POSIX AIO implementation.
23 Use of this function is optional, but to be effective,
24 it must be called before employing any other functions in the POSIX AIO API.
26 The tuning information is provided in the buffer pointed to by the argument
27 .IR init .
28 This buffer is a structure of the following form:
30 .in +4n
31 .EX
32 struct aioinit {
33     int aio_threads;    /* Maximum number of threads */
34     int aio_num;        /* Number of expected simultaneous
35                            requests */
36     int aio_locks;      /* Not used */
37     int aio_usedba;     /* Not used */
38     int aio_debug;      /* Not used */
39     int aio_numusers;   /* Not used */
40     int aio_idle_time;  /* Number of seconds before idle thread
41                            terminates (since glibc 2.2) */
42     int aio_reserved;
44 .EE
45 .in
47 The following fields are used in the
48 .I aioinit
49 structure:
50 .TP
51 .I aio_threads
52 This field specifies the maximum number of worker threads that
53 may be used by the implementation.
54 If the number of outstanding I/O operations exceeds this limit,
55 then excess operations will be queued until a worker thread becomes free.
56 If this field is specified with a value less than 1, the value 1 is used.
57 The default value is 20.
58 .TP
59 .I aio_num
60 This field should specify the maximum number of simultaneous I/O requests
61 that the caller expects to enqueue.
62 If a value less than 32 is specified for this field,
63 it is rounded up to 32.
64 .\" FIXME . But, if aio_num > 32, the behavior looks strange. See
65 .\" http://sourceware.org/bugzilla/show_bug.cgi?id=12083
66 The default value is 64.
67 .TP
68 .I aio_idle_time
69 This field specifies the amount of time in seconds that a
70 worker thread should wait for further requests before terminating,
71 after having completed a previous request.
72 The default value is 1.
73 .SH STANDARDS
74 GNU.
75 .SH HISTORY
76 glibc 2.1.
77 .SH SEE ALSO
78 .BR aio (7)