RFR [8058099] (ch) Cleanup in FileChannel/FileDispatcher native implementation [win]
Alan Bateman
Alan.Bateman at oracle.com
Mon Sep 22 08:03:08 UTC 2014
On 10/09/2014 11:36, Ivan Gerasimov wrote:
> Hello!
>
> This is a proposal to slightly rework FileChannel/FileDispatcher
> native implementation on Windows.
> If the newer API is used (which is already available on XP and 2003),
> this will make code a bit clear and let us save a few redundant calls.
>
> Would you please help review the change?
>
> BUGURL: https://bugs.openjdk.java.net/browse/JDK-8058099
> WEBREV: http://cr.openjdk.java.net/~igerasim/8058099/0/webrev/
I've finally found time to look at this.
The update to position0 looks good. There isn't a need to init result to
0 but it doesn't matter either way. Same thing in size0.
With the changes to pread0 and pwrite0 then we are using an OVERLAPPED
structure to specify the position to ReadFile/WriteFile. Are we
guaranteed that these will always execute synchronously and that
ERROR_IO_PENDING will not be returned?
The other clean-up and switch to SetFilePointerEx and GetFileSizeEx
looks good.
-Alan.
More information about the nio-dev
mailing list