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

(se) PollSelector loses more events than DevPollSelector when SelectionKeys used across threads

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      generic
    • OS:
      solaris_9

      Description

      Possibly we are on illegal territory with the premise for this problem: updating the events of interest for a SelectionKey while another thread is sleeping in a poll on that key.

      This update works using the DevPollSelector.

      While "it works using DevPoll" does not make it right, it would offer less surprise to the programmer if we had the as much as possible the same behaviour in each implementation. Plus, implementing the simple list of udpates is straightforward.

      While we warn in the API docs that Selectors are safe to use in multiple threads but their keys are not, it would be nice to make as much as possible of this API safe across multiple threads. Also, from reading the API document it's not 100% clear that what we are doing is illegal: we are only updating a key's interest events in one thread at once.


      ###@###.### 2005-07-08 16:32:55 GMT
      ###@###.### 2005-07-11 18:13:17 GMT

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              kevinw Kevin Walls
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: