I understand that the java implementation is based on the unix select() c function (I seem to remember that the Windows implementation was a bit different)
Depending on the OS (and JVM args!), Different native OS functions are called, but what they have in common is that this is their own code - the basic functionality is not implemented in Java.
If you want to create a lib that accesses the select() (or the like) of the underlying OS (which really relies on file descriptors), I think you are pretty much forced to use JNI. I do not believe that there are any ways around.
The / SelectableChannel in Java is indeed an anemic subset of what select() can do.
Nuoji
source share