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

(se) selector read/write values out of sync with underlying values used to poll the channel

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 1.4.1
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      Name: dk106046 Date: 05/14/2003

      The read/write values in a selector can get out of sync with the underlying read/write values
      used to poll the channel.


      ------------
      A client/server application which creates many threads, each of which is available to process a read or
      write from the same channel. Each time a selector is finished with by a thread it is disposed (after
      100 uses by default). During reading from a channel, the read/write interest on the selector is changed
      so that read interest is removed whilst reading, and restored after reading.

      As deregistration (implDereg) alters the order of the unerlying list of file interests by copying the
      last record to the one to be deregistered, then removing the last record, it is possible that the
      deregsitration is in process whilst the last record is being updated by a read operation, such that
      the modification of the read interest (either adding or removing it) gets lost.
      It is not sufficient to synchronize on the selector being de-registered, you also have to synchronize
      on the last one in the list to safely deregister.

      There is no minimal set of code which reproduces this, it requires the full client/server Nio test
      from the SVT suite.
      ======================================================================
      --

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              alanb Alan Bateman
              Reporter:
              dkorbel David Korbel (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: