man-pages/man3/aio_init.3.html
2021-03-31 01:06:50 +01:00

142 lines
4.5 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of AIO_INIT</TITLE>
</HEAD><BODY>
<H1>AIO_INIT</H1>
Section: Linux Programmer's Manual (3)<BR>Updated: 2017-09-15<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
aio_init - asynchronous I/O initialization
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<PRE>
<B>#define _GNU_SOURCE</B> /* See <A HREF="/cgi-bin/man/man2html?7+feature_test_macros">feature_test_macros</A>(7) */
<B>#include &lt;<A HREF="file:///usr/include/aio.h">aio.h</A>&gt;</B>
<B>void aio_init(const struct aioinit *</B><I>init</I><B>);</B>
</PRE>
<P>
Link with <I>-lrt</I>.
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
The GNU-specific
<B>aio_init</B>()
function allows the caller to provide tuning hints to the
glibc POSIX AIO implementation.
Use of this function is optional, but to be effective,
it must be called before employing any other functions in the POSIX AIO API.
<P>
The tuning information is provided in the buffer pointed to by the argument
<I>init</I>.
This buffer is a structure of the following form:
<P>
struct aioinit {
<BR>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;aio_threads;&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;Maximum&nbsp;number&nbsp;of&nbsp;threads&nbsp;*/
<BR>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;aio_num;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;Number&nbsp;of&nbsp;expected&nbsp;simultaneous
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;requests&nbsp;*/
<BR>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;aio_locks;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;Not&nbsp;used&nbsp;*/
<BR>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;aio_usedba;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;Not&nbsp;used&nbsp;*/
<BR>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;aio_debug;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;Not&nbsp;used&nbsp;*/
<BR>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;aio_numusers;&nbsp;&nbsp;&nbsp;/*&nbsp;Not&nbsp;used&nbsp;*/
<BR>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;aio_idle_time;&nbsp;&nbsp;/*&nbsp;Number&nbsp;of&nbsp;seconds&nbsp;before&nbsp;idle&nbsp;thread
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;terminates&nbsp;(since&nbsp;glibc&nbsp;2.2)&nbsp;*/
<BR>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;aio_reserved;
};
<P>
The following fields are used in the
<I>aioinit</I>
structure:
<DL COMPACT>
<DT id="1"><I>aio_threads</I>
<DD>
This field specifies the maximum number of worker threads that
may be used by the implementation.
If the number of outstanding I/O operations exceeds this limit,
then excess operations will be queued until a worker thread becomes free.
If this field is specified with a value less than 1, the value 1 is used.
The default value is 20.
<DT id="2"><I>aio_num</I>
<DD>
This field should specify the maximum number of simultaneous I/O requests
that the caller expects to enqueue.
If a value less than 32 is specified for this field,
it is rounded up to 32.
The default value is 64.
<DT id="3"><I>aio_idle_time</I>
<DD>
This field specifies the amount of time in seconds that a
worker thread should wait for further requests before terminating,
after having completed a previous request.
The default value is 1.
</DL>
<A NAME="lbAE">&nbsp;</A>
<H2>VERSIONS</H2>
The
<B>aio_init</B>()
function is available since glibc 2.1.
<A NAME="lbAF">&nbsp;</A>
<H2>CONFORMING TO</H2>
This function is a GNU extension.
<A NAME="lbAG">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?7+aio">aio</A></B>(7)
<A NAME="lbAH">&nbsp;</A>
<H2>COLOPHON</H2>
This page is part of release 5.05 of the Linux
<I>man-pages</I>
project.
A description of the project,
information about reporting bugs,
and the latest version of this page,
can be found at
<A HREF="https://www.kernel.org/doc/man-pages/.">https://www.kernel.org/doc/man-pages/.</A>
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="4"><A HREF="#lbAB">NAME</A><DD>
<DT id="5"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="6"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="7"><A HREF="#lbAE">VERSIONS</A><DD>
<DT id="8"><A HREF="#lbAF">CONFORMING TO</A><DD>
<DT id="9"><A HREF="#lbAG">SEE ALSO</A><DD>
<DT id="10"><A HREF="#lbAH">COLOPHON</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:35 GMT, March 31, 2021
</BODY>
</HTML>