RFR: 8266369: (se) Add wepoll based Selector [v2]
Alan Bateman
alanb at openjdk.java.net
Wed May 5 15:34:49 UTC 2021
On Wed, 5 May 2021 15:14:14 GMT, Chris Hegarty <chegar at openjdk.org> wrote:
>> It often happens in this area that Net and IOUtil define methods that aren't implemented on all platforms. In this case, discardOOB is generally useful and we can add it on other platforms when needed. I didn't add it now because it would not be used or tested.
>
> This attracted my attention because it is a new native method. I don't see any other native methods unimplemented here, but I only skimmed over the code. Seems very fragile, since it will (may) throw a linkage error if called on non-Windows platforms - without any help from the compiler, we are dependent on good tests to catch such. If this is an established pattern, then ok, but I would like to revisit it separately to this PR.
IOUtil.makePipe is another example. It has been there since JDK 1.4 but doesn't have an implementation on Windows. The Net.localXXX methods didn't have implementations on all platforms for a long time too. So yes, if someone where to write some platform specific code in sun.nio.ch and use one of the unimplemented methods then it would be an error at runtime.
-------------
PR: https://git.openjdk.java.net/jdk/pull/3816
More information about the nio-dev
mailing list