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

(se) Selector implementations do not need to use cancelledKeys

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 14
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b17

      Description

      A long standing complaint is that using the Selector API can involve a lot of short lived objects and GC. JDK-8199433 added new APIs in Java SE 11 to invoke an action with the selected keys rather than adding it to the selected-key set and that eliminated most of the issue for code that migrates to the newer API. One remaining issue is the cancelled key set. When a key is cancelled it is added to this set for the next selection operation. The cancelled key set is not accessible (except to custom Selector implementations) so there is scope to replace this usage.

        Attachments

          Activity

            People

            Assignee:
            alanb Alan Bateman
            Reporter:
            alanb Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: