Share via


Implementing Asynchronous Failure Detection

When Online is called for a resource instance, you have the option of returning a handle to a synchronization object (an "event handle"). This has the following effects:

  • The Resource Monitor will not call the LooksAlive entry point function for that instance, regardless of the LooksAlivePollInterval setting.
  • You can signal the handle at any time to indicate a possible failure in a resource instance. Signaling the handle causes the Resource Monitor to call Terminate immediately. The event handle allows you to report failure asynchronously from anywhere in your resource DLL.

To implement asynchronous failure detection

  • Recommended: If you support multiple resource instances, devise a system so that one synchronization object serves several (if not all) resource instances. The routine that signals the handle should identify the instance that has failed for your Terminate routine.