RFR: 8266369: (se) Add wepoll based Selector [v2]

Alan Bateman alanb at openjdk.java.net
Wed May 5 10:01:54 UTC 2021


On Wed, 5 May 2021 09:33:51 GMT, Michael McMahon <michaelm at openjdk.org> wrote:

>> Alan Bateman has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision:
>> 
>>  - Merge
>>  - Propagate exception from discardOOB, cleanup
>>  - Merge
>>  - Use 'to' instead of '(int) timeout
>>  - Move SelectorWakeup micro to channels directory
>>  - Initial commit
>
> src/java.base/windows/classes/sun/nio/ch/WEPoll.java line 57:
> 
>> 55:     private static final int OFFSETOF_EVENTS     = eventsOffset();
>> 56:     private static final int OFFSETOF_FD         = dataOffset();
>> 57: 
> 
> The naming here seems a bit inconsistent. The field in the union is called 'sock' but the constant value here refers to OFFSETOF_FD. Would OFFSETOF_SOCK be better? Also, is the getDescriptor() method needed as it doesn't seem to be called? What drew my attention to it is that 'fd' is an int size, but socket handles are long sized (which is how they are accessed through `getSocket`

It's a union and they have the same offset. But okay, there may not be a need to provide access to data.fd, in which case getDescriptor could be removed and the private field renamed.

-------------

PR: https://git.openjdk.java.net/jdk/pull/3816


More information about the nio-dev mailing list