question regarding lio_listio
Amos Waterland
apw@us.ibm.com
Mon Dec 2 12:26:00 GMT 2002
On Mon, Dec 02, 2002 at 07:05:17AM +0530, Bourne wrote:
> Was wondering if we could use lio_listio to enqueue aio requests in a
> particular order ?
> Ex : if we could process a read only after a write has completed. i.e
> strictly in that fashion.
The relevant standard
(http://www.opengroup.org/onlinepubs/007904975/functions/lio_listio.html)
says:
int lio_listio(int mode, struct aiocb *restrict const list[restrict],
int nent, struct sigevent *restrict sig);
The I/O requests enumerated by list are submitted in an unspecified
order.
With respect to your example, it looks like you don't actually want aio,
since you want the read to wait until the write completes. You can get
the effect it appears you want (though it seems pointless to use aio) as
follows:
aio_read (&cb);
while (aio_error (&(cb)) == EINPROGRESS)
usleep (10);
aio_write (&cb);
More information about the Libc-alpha
mailing list