AsynchronousFileChannel.open() - is it blocking?
Alan Bateman
Alan.Bateman at oracle.com
Fri Mar 2 00:46:43 PST 2012
On 01/03/2012 22:52, Zhong Yu wrote:
> Is open() a potentially blocking action? Apparently so because some
> sanity checking (e.g. existence of the file) requires disk spin. If
> that's the case, it should probably be explicitly documented.
>
> And after open(), are following methods blocking or non-blocking?
>
> size();
> truncate();
>
The asynchronous operations defined by AsynchronousFileChannel are read,
write, and lock. The other methods, including the open method to create
or open the file, are synchronous and potentially blocking.
-Alan.
More information about the nio-dev
mailing list