How do I make vectored AIO calls? - Linux

This is a discussion on How do I make vectored AIO calls? - Linux ; Hi, Please forgive my ignorance of the linux file system API; I've obviously spent far too long in Java land! I have been working on a Java/C implementation of the Java NIO.2 specification (JSR 203 I think), and have implemented ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: How do I make vectored AIO calls?

  1. How do I make vectored AIO calls?

    Hi,

    Please forgive my ignorance of the linux file system API; I've
    obviously spent far too long in Java land! I have been working on a
    Java/C implementation of the Java NIO.2 specification (JSR 203 I
    think), and have implemented asynchronous file IO using the Posix API
    exposed in 'aio.h'.

    The Posix API does not expose vectored asynchronous reads and writes
    (aio_readv and aio_writev). I do know that the Linux kernel supports
    vectored asynchronous io (I'm on 2.6.22), and I have checked the
    source to see that patches for this are in fact there. So my question
    is, where is the API to use this? I'm guessing that I need to use the
    linux native filesystem API and pass it a structure with flags set
    correctly in it to request the style of io operation I am after. Do I
    do this though a call to readv/writev? How are asynchronous completion
    notifications delivered? A small example or pointers to where I can
    learn more would be very much appreciated. Thanks for any help you can
    give.

    Rupert

    P.S. I can obviously do the vectored calls through the Posix API by
    copying blocks of memory, but that kind of misses the point.

  2. Re: How do I make vectored AIO calls?

    On May 8, 1:22 pm, "rupertlssm...@googlemail.com"
    wrote:
    > Hi,
    >
    > Please forgive my ignorance of the linux file system API; I've
    > obviously spent far too long in Java land! I have been working on a
    > Java/C implementation of the Java NIO.2 specification (JSR 203 I
    > think), and have implemented asynchronous file IO using the Posix API
    > exposed in 'aio.h'.
    >
    > The Posix API does not expose vectored asynchronous reads and writes
    > (aio_readv and aio_writev). I do know that the Linux kernel supports
    > vectored asynchronous io (I'm on 2.6.22), and I have checked the
    > source to see that patches for this are in fact there. So my question
    > is, where is the API to use this? I'm guessing that I need to use the
    > linux native filesystem API and pass it a structure with flags set
    > correctly in it to request the style of io operation I am after. Do I
    > do this though a call to readv/writev? How are asynchronous completion
    > notifications delivered? A small example or pointers to where I can
    > learn more would be very much appreciated. Thanks for any help you can
    > give.
    >
    > Rupert
    >
    > P.S. I can obviously do the vectored calls through the Posix API by
    > copying blocks of memory, but that kind of misses the point.


    OK. I think I figured this one out for myself. I need to install
    libaio, and the API calls to use it are exposed in 'libaio.h'.

    Rupert

+ Reply to Thread