Real async file IO on Linux?

Tim Fox timvolpe at gmail.com
Wed Jul 27 02:22:07 PDT 2011


Hello All,

In anticipation of the iminent Java 7 release, I took a look at the 
source for asynchronous file IO, and it seems to be "faking" async IO by 
hiding old synchronous IO behind a thread pool.

I'm interested in understanding why real OS async file IO hasn't been 
used for those operating systems that support it. I'm particularly 
interested in Linux support.

(Background: Some time back I wrote a messaging system called HornetQ. 
HornetQ is written primarily in Java with a small amount of C accessed 
via JNI that does Linux Kernel AIO for file persistence. We did this 
since kernel AIO can give better latency / performance than using 
synchronous IO and fsync'ing. I was hoping that with Java 7 we could 
lose this layer of native code, as the JDK would do this for us, but 
that doesn't seem to be the case :(
There is some more info on this here 
http://docs.jboss.org/hornetq/2.2.5.Final/user-manual/en/html/persistence.html 
)

Thanks,

Tim Fox


More information about the nio-discuss mailing list