Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8266382

(se) Add wepoll based Selector

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 17
    • core-libs
    • None
    • behavioral
    • minimal
    • System or security property
    • Implementation

      Summary

      Change the default implementation of the java.nio.channels.Selector API on Microsoft Windows to a new implementation that is significantly more scalable than the existing implementation.

      Problem

      The default implementation of the Selector API on Microsoft Windows is based on the Windows Sockets "select" function. The implementation has existed since JDK 1.4 and scales horribly, partly because select is O(N) on the number of sockets to poll, partly because select is limited to 1024 sockets and so requires a pool of threads when there are thousands of selectable channels registered with a Selector.

      Solution

      Change the default implementation to a new "wepoll" based Selector. wepoll is a library that provides a scalable polling interface to the Ancillary Function Driver for Winsock. It scales on the number of sockets that are ready for I/O rather than the number of sockets that are polled.

      Keep the old implementation, unchanged. The JDK can be configured to use the old implementation by running with the system property "java.nio.channel.spi.SelectorProvider" (specified in the API docs for SelectorProvider) set to the value of "sun.nio.ch.WindowsSelectorProvider".

      A release note is planned to create awareness of the new implementation and to document how to switch back to the old implementation. We have not observed any behavioral or compatibility differences in testing to date.

      Specification

      There are no specification changes, this is an implementation-only change.

            alanb Alan Bateman
            alanb Alan Bateman
            Brian Burkhalter, Chris Hegarty
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: