selectionKeys with readyOps that match interestOps are not picked up by the selector that they are registered with. This seems to only happen when interestOps are dynamically updated (with approproate synchronisation safeguards) on a registered key.
The test case uses the standard pattern for developing a multi-threaded, NIO-based, network server at least up to the point in which inetestOps are modified for a Write event. Start the test case specifying a port number and 'false' as arguments and then connect to the port via telnet. Type something and hit return. Tne most frequently seen behaviour is that the app disconnects you, if you then repeat this step a few times, ultimately you do not get disconnected. On my test environment it always broke on the first connect. If 'false' is replaced on the command line with 'true' an extra level of synchronisation is added around the call to select() and this resolves the problem.
This problem is not reproducible on all systems and does not occur on Windows (and possibly Linux).
###@###.### 2005-03-14 17:34:37 GMT
The test case uses the standard pattern for developing a multi-threaded, NIO-based, network server at least up to the point in which inetestOps are modified for a Write event. Start the test case specifying a port number and 'false' as arguments and then connect to the port via telnet. Type something and hit return. Tne most frequently seen behaviour is that the app disconnects you, if you then repeat this step a few times, ultimately you do not get disconnected. On my test environment it always broke on the first connect. If 'false' is replaced on the command line with 'true' an extra level of synchronisation is added around the call to select() and this resolves the problem.
This problem is not reproducible on all systems and does not occur on Windows (and possibly Linux).
###@###.### 2005-03-14 17:34:37 GMT
- duplicates
-
JDK-6295054 (se) PollSelector loses more events than DevPollSelector when SelectionKeys used across threads
-
- Closed
-