This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: aio : implementation for requesting free elements


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]