Direct I/O

Discussion in 'Java' started by Tony Hannan, Jan 23, 2006.

  1. Tony Hannan

    Tony Hannan Guest

    Hello all,

    Do the direct buffers in the java.nio package have the same effect as
    using the open function with the O_DIRECT flag in Linux?

    I am the TA for a database implementations class and we want to access
    disk directly and do our own buffering. We are treating a single OS file
    like a disk partition.

    Thanks,
    Tony
     
    Tony Hannan, Jan 23, 2006
    #1
    1. Advertising

  2. Tony Hannan wrote:
    > Hello all,
    >
    > Do the direct buffers in the java.nio package have the same effect as
    > using the open function with the O_DIRECT flag in Linux?


    I can't tell for sure from the docs, which means that you cannot rely on
    it being so. The two sound similar, but it is not clear whether an NIO
    direct buffer bypasses only Java-side caching or both Java and native
    caching.

    > I am the TA for a database implementations class and we want to access
    > disk directly and do our own buffering. We are treating a single OS file
    > like a disk partition.


    I know of nothing more likely to get what you ask in Java than a direct
    ByteBuffer, as you suggested. If you are not already aware of it, then
    you should also look at method FileChannel.force() as a complement /
    failsafe.

    Sorry I can't be more definite.

    --
    John Bollinger
     
    John C. Bollinger, Jan 24, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. valentin tihomirov

    direct instantiation, libraries

    valentin tihomirov, Apr 23, 2004, in forum: VHDL
    Replies:
    6
    Views:
    1,898
    valentin tihomirov
    Apr 26, 2004
  2. Rick Jackson
    Replies:
    8
    Views:
    2,732
    Rolf Eike Beer
    Dec 2, 2005
  3. sampriti
    Replies:
    0
    Views:
    341
    sampriti
    Jul 9, 2003
  4. Rodrigo C Souza

    How to copy to a file direct to a flopy disk?

    Rodrigo C Souza, Jan 5, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    765
    Kevin Spencer
    Jan 5, 2004
  5. .NET Follower
    Replies:
    1
    Views:
    484
    Andy Mortimer [MS]
    Feb 13, 2004
Loading...

Share This Page