Recommended Practices for Resource DLLs

The following items should be taken into account when implementing a resource DLL.

Avoid operations that cause deadlocks in resource DLLs.

See Function Calls to Avoid in Resource DLLs.

For optimal performance of the cluster and maximum availability for your resources, all entry points should return a value in 300 milliseconds or less.

If your implementation needs more time, create a worker thread to handle the operation asynchronously and return a value immediately. A resource DLL is non-reentrant for all entry points except for the Terminate entry point function. Thus, while your DLL is processing an entry point function, your other entry points (except Terminate) are blocked. In general, the Terminate entry point function can be called concurrently with any entry point function (such as IsAlive, LooksAlive, Offline, Online, ResourceControl, and ResourceTypeControl) except for initialization functions (such as DllMain and Startup) and resource instance management functions (such as Open and Close). Any resources that are accessed by these entry points must be properly guarded.

The Cluster API will not be available to your DLL until the Cluster service has started.

Your DLL receives notification that the Cluster service has started through the CLUSCTL_RESOURCE_TYPE_STARTING_PHASE2 control code.

Starting in Windows Server 2012, you should author only 64-bit resource DLLs.

32-bit cluster resource DLL support is available for use through Windows Server 2012, but it may be altered or unavailable in subsequent versions.

 

 

Show: