This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: aio : implementation for requesting free elements
- From: "Carlos O'Donell" <carlos at systemhalted dot org>
- To: paul dot chavent at fnac dot net
- Cc: libc-help at sourceware dot org
- Date: Fri, 2 May 2008 09:51:45 -0400
- Subject: Re: aio : implementation for requesting free elements
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=QcJMoYU5erzHWBpP7uw73fSrOsOnPrK+Iu9+E7MCsw8=; b=SvnDz9E3OFvkDJM2uk6mbWPDsVJ7T7ibOZw0UzxbXaajPsVsMCQc4qagl6NMPRq1xlxGjbMvFkjWH5LNE3vYQP8d+d5L48Fcmww4fwIpKHGSkVHE+KylTbx9lrdw7fG5pxtOEEDcT1WGsAJ92Id+6VbxyrwEFj+10ihMLYIBKjg=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=aRmcoDduas1GIUhwaut3kBDFYyMVkA05Xigp+UQVI5uTX+7vZnWoabkQvj+1l6toYja878mHjj14rH9hFgf0Ec1A7tReLr3hIpPO4fgpswuEmexJ3X5ao2E8V2feWUwshefjbGUugiUhat+r88DXOseOIJ4WE6dk65MBARpXBFM=
- References: <8CA78C7D33B9BBA-86C-A2B@FRR1-L18.sis.aol.com>
On Wed, Apr 30, 2008 at 6:55 AM, <paul.chavent@fnac.net> wrote:
> My question is why we only take care of the aio_num at the first row (line
> 137 in the 2.7 release)
> 8<--------------------------------------------------------
> /* Allocate the new row. */
> cnt = pool_size == 0 ? optim.aio_num : ENTRIES_PER_ROW;
> new_row = (struct requestlist *) calloc (cnt, sizeof (struct requestlist));
> 8<--------------------------------------------------------
If your program says that aio_num is the maximum number of requests to
make, then the AIO implementation allocates 1 row of aio_num elements
(lazily at the first call to get_elem). You will only ever need 1 row
if you keep your requests below aio_num. This is why it only does this
on the first row.
> Moreover, the documentation says :
> 8<--------------------------------------------------------
> aio_num
> This number provides an estimate on the maximal number of simultaneously
> enqueued requests.
> 8<--------------------------------------------------------
>
> But i can't find, in the implementation, any check that limits the number
> of requests according to aio_num...
This is an estimate and not a hard limit. If get_elem exceeds the pool
size then it grows by 1 row * ENTRIES_PER_ROW (and possibly growing
the pool ** list to hold the new entries).
> Could you tell me if i misunderstood anything please ?
Does that help?
Cheers,
Carlos.