Hi, everyone, I found in the mina contributors, there is an asynchronousFileIO that is using aio_read in linux. The URL is http://mina.apache.org/asynchronous-file-io-in-java.html
It happens that I decide to try to replace the RandomAccessFile in my project. Our system is a large and busy system based on huge files in Linux. When profiling, I found that a lot of blocking/waiting in file IO on the same file descriptor. When there is some operation asking for a lot of IO requests(it's quiet often in our system), other threads will be affected. So I just finished an experimental modification that invokes aio_read in Linux in JNI. Since our system is running only in Linux, so it will be good for us. But when I tested the performance, the results depressed me. The performance is three times lower than the RandomAccessFile in 5 threads. I search the internet to ses if there's any other one to try that like what I did. Then I found it in the mina contributors. The codes are almost the same with what I did. The difference is just that I'm using C and the contributors' codes are using c++. I want to know if you tested the performance and compared with the sun's RandomAccessFile? What's the result? I also looked into sun's native method opened some time ago. The j2se/share/native/java/io/io_util.c has the detailed codes. It doesn't have any tricky codes. The only one is that it's using a stack variable byte array if the read length is less than 8K. But in the aio_read, it doesn't work. Because we have to allocate new memory to contain the results or using the byte array passed into the native codes. It has to be in the heap. Even so, I don't think it will affect so much . Thanks in advance. I also want to know how to contact Mike Heath<http://cwiki.apache.org/confluence/users/viewuserprofile.action?username=mheath>. He contributes the codes. -- -- Yueyu Lin
