On Sun, Feb 06, 2000 at 02:41:19AM -0800, Ananth Anathanarayanan wrote:
> I don't believe the interweaving of the buffers is possible, since,
> presumably the offsets were specified correctly in the aiocb's even
> if they all write to the same file. For example, the write of "one"
> specifies an offset 0, the write of "two" specifies an offset of 3,
> the write of "three" specifes an offset of 6. This would guarantee
> only one possibility, "onetwothree". lio_listio() itself does not
> impose or relax any condition that the individual aio's do not
> possess.
This is the case of O_APPEND is not set. However, if you're doing
sockets I would presume you'd have no choice but to use O_APPEND for a
write. The spec for aio_write() says that it will guaruntee that
appends on the same fd get done in the order they are invoked. I'm
just wondering how tht plays out with lio_listio().
> > Additionally, I'm curious about the sig argument in lio_listio(). If
> > the sig argument is set, and each of the individual aiocb's in the
> > listio() list ALSO have their aio_sigevent field set. Do both signals
> > get triggered?
> Both the individual signals in each aiocb and the final signal for
> the completion of the whole list_io get triggered.
Ok. Then I assume I can have any one of them enabled, which is very
convenient.
> > P.S.: Any feel as to whether lio_listio() provides significant
> > performance advantages over aio_read() & aio_write()?
>
> Since the list_io uses fewer system calls, I'd think that it is
> more efficient, but then again it depends on your usage/requirements.
> For example, if you are going to use aio to achieve parallelism
> in the IO, you may just want to issue a whole bunch of IO's and
> wait for it. In this case, it would be more efficient to issue
> all the IOs with list_io and specify LIO_WAIT, rather than
> do it as individual aio_*() and aio_suspend(), etc.
>
> hope this helps!
Definitely helps a lot. I thought about using LIO_WAIT, but then I'd
probably end up spawning several threads. So, I'll probably go with
LIO_NOWAIT and then trap the signals. It should be fun. ;-)
--Chris
|