Thread pool configuration
Alan Bateman
Alan.Bateman at Sun.COM
Fri Nov 21 08:37:11 PST 2008
Avinash Lakshman wrote:
> Do the FileChannel's transferTo() and transferFrom() methods use the
> AIO framework or are they synchronous in nature? I remember reading
> somewhere that the Linux sendfile() implementation relies on O_DIRECT
> to not disturb the page cache. Any truth to this?
FileChannel defines synchronous operations. The facility that the
transferTo/transferFrom methods use depend on the target (or source)
channel. For example, if you transferTo a socket channel then it will
use sendfile; if you transferTo another file channel then it uses memory
mapped I/O. We don't have FileChannel integrated with
AsynchronousSocketChannel yet but this is something I hope to address.
Direct I/O bypasses the file system cache so great for databases and
other very advanced cases that do their own caching. This is not
something that the average application will use (requires careful
alignment of buffers and file offsets for example).
-Alan.
More information about the nio-discuss
mailing list