Real async file IO on Linux?
Alan.Bateman at oracle.com
Thu Jul 28 11:38:56 PDT 2011
Dane Foster wrote:
> I completely & totally agree w/ Tim. I would love to see true non
> buffered async IO support instead of the emulation of async IO. The
> current implementation reminds me of green threads from way back when,
> in that they never actually addressed the issue of fully utilizing a
> SMP (or in today's terminology, multi-core) system, it just gave the
> programmer the illusion that it did (w/ the added cost of being slow
> and inefficient), in the same way that the current async IO
> implementation is an illusion of true async IO. I never said anything
> before because I had assumed that the emulation mechanism was a
> fallback mechanism for when async IO support was not available on a
> platform. I did not realize, until this thread started, that platform
> async IO support meant the buffered case to you.
As I said, there's nothing here to preclude supporting non-buffered I/O
and patches are always welcome on nio-dev. The place to plug this in is
in UnixChannelFactory.newAsynchronousFileChannel which can select the
implementation to use based on the open options. In the Windows case
then it already selects an implementation based on the Windows
asynchronous I/O API. As per prior discussions on the nio-* lists then
there isn't any guarantee on the alignment of direct buffers and in
addition information to allow applications size and get appropriately
aligned file offsets would need to be considered. Nothing particularly
hard to implement but clearly something for advanced developers.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the nio-discuss