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

Document that NotificationBroadcaster implementations must be careful about synchronization

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 6
    • 6
    • core-svc
    • b47
    • generic
    • generic

      Implementing javax.management.NotificationBroadcaster carries hidden risks of deadlock. Earlier versions of NotificationBroadcasterSupport exhibited this deadlock and code that was inspired by those versions may still. The documentation should draw attention to this potential problem. Specifically, it should say that an implementation of NotificationBroadcaster should not hold any locks while distributing a Notification to its listeners since those listeners can execute arbitrary actions, which might include provoking another thread to attempt to obtain the same lock. It might be worth mentioning the possible use of java.util.concurrent.CopyOnWriteArrayList here.
      ###@###.### 2005-03-11 11:33:54 GMT

            emcmanus Eamonn McManus
            emcmanus Eamonn McManus
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: