Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

139 lines
5.2 KiB

  1. In addition to the single ESS object, there will be namespace representation
  2. objects, containing:
  3. ----------------------------------------------------------------------------
  4. - namespace pointer
  5. - update lock
  6. - binding table
  7. - poller
  8. - provider cache
  9. - consumer provider cache
  10. - tree for database event filtering
  11. The main ESS object is left with:
  12. - searchable list of namespace representation objects
  13. - the thread pool
  14. - the timer
  15. - the event log
  16. There are several types of operations that affect event registrations;
  17. ----------------------------------------------------------------------
  18. 1) Creation and deletion of event filters.
  19. 2) Creation and deletion of bindings.
  20. 3) Creation and deletion of event provider registrations.
  21. 4) Creation, deletion and modification of class definitions.
  22. 5) Creation and deletion of consumer provider registrations.
  23. These operations will affect the following updatable objects:
  24. -------------------------------------------------------------
  25. 1) Event filters (CEventFilter): creation, deletion, binding list change,
  26. activation, deactivation.
  27. 2) Event Consumers (CPermanentConsumer): creation, deletion, consumer provider
  28. reference.
  29. 3) Provider pods: filter tree updates in proxies.
  30. The following objects can only be created or deleted, not modified in an update:
  31. --------------------------------------------------------------------------------
  32. 1) Bindings (CBinding)
  33. 2) Polling instructions.
  34. Implementation of each one of these operations will proceed as follows:
  35. -----------------------------------------------------------------------
  36. a) the namespace object is locked for update and the thread is marked as
  37. updating this namespace
  38. b) The current state of the object in question (__EventFilter,
  39. __FilterToConsumerBinding, __Provider, __EventProviderRegistration,
  40. __EventConsumerProviderRegistrastion instance, or the class definition)
  41. is retrieved. The operation is modified to reflect the current state.
  42. c) All the updatable and deletable objects listed above that may be affected by
  43. this change are locked for update. Creatable objects are created and locked.
  44. Notice that this can hang if some of
  45. these objects are participating in an ongoing update. This will leave the
  46. entire namespace locked for update until the ongoing one completes --- by
  47. design. Note: the act of locking will AddRef the objects.
  48. d) The namespace object is unlocked.
  49. e) All the objects are instructed to perform the changes
  50. f) Update lock is released. This has the affect of releasing the objects, so
  51. those of them that have been deleted will go away at this time.
  52. g) The thread is "unmarked".
  53. Re-entrancy issues --- two possibilities:
  54. -----------------------------------------
  55. - no reentrancy: any marked thread attempting an update shall fail
  56. - limited reentrancy: any marked thread attempting to lock an object for an
  57. update shall fail if the object is locked by this thread, or block if the
  58. object is locked by another thread.
  59. Sequence of update lock acquisitioins:
  60. --------------------------------------
  61. 1) Namespace object
  62. 2) Filters
  63. 3) Consumers
  64. 4)
  65. Category (1): Event Filter creation
  66. -----------------------------------
  67. Affected objects:
  68. - Provider records whose definition queries intersect with this one.
  69. Non-exclusive changes:
  70. - Activate provider, call NewQuery, inform proxies of the change
  71. Note: the proxy will get exclusive lock while actually updating the
  72. tree. However, this lock will not be held while the proxy is
  73. talking to the stub.
  74. Exclusive changes:
  75. - update the list of filters.
  76. Created objects:
  77. - Event Filter
  78. - Polling instruction
  79. - Aggregating instruction
  80. Activating a filter
  81. -------------------
  82. When a filter is activated, the update lock is held on the filter and all the
  83. provider pods whose registration queries intersect with the filter. No exclusive
  84. locks are held. The tasks are: registering with all the provider pods and
  85. creating the appropriate polling instructions. Throughout these operations,
  86. a recording meta-data access point will be used to record the list of class
  87. names that were accessed. This list will be used to see if re-activation is
  88. needed when a class definition changes.
  89. Activation and polling selection mechanisms will not be changed in M3, despite
  90. their shortcomings.
  91. Aggregator for this filter is not separately protected.
  92. Exclusive lock on CEventFilter will be held only while the activation state
  93. is changed.
  94. Deactivating a filter
  95. ---------------------
  96. Update locks are held on the filter, all the affected provider pods, and the
  97. polling instruction for this filter.
  98. Category (4): Class definition change
  99. -------------------------------------
  100. Note that since separate events are fired by the core for all the children of
  101. the class being changed, it is safe to only update the objects directly affected
  102. by this class. In particular, a filter is considered affected by a change to
  103. class A if this class was accessed during construction of the tree for this
  104. filter.
  105. Affected objects:
  106. - non