aio : implementation for requesting free elements

paul.chavent@fnac.net paul.chavent@fnac.net
Wed Apr 30 11:49:00 GMT 2008


Hi.

I evaluate the aio for a real-time application. I would like to avoid 
every allocation and thread creation at run-time.

So i read the implementation of aio in sysdeps/pthread/aio_misc.c

For allocating the requests there are two step :
- 1 - allocate a pool of 8 row of requests
- 2 - allocate an array of 32 or aio_num requests.

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<--------------------------------------------------------

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...

Could you tell me if i misunderstood anything please ?

Thank you.

Paul.




More information about the Libc-help mailing list