摘要 |
The present invention provides a method of implementing a fault-tolerant mutual exclusion lock. The present invention records in a lock structure the IDs of all processes whose failure can lead to the permanent unavailability of the lock. When a process finds the lock unavailable and suspects a permanent failure, it queries the programming environment about the status of all or some of the processes that could have caused the lock's unavailability. If the programming environment determines that these processes have failed, the live process tries to usurp the lock. If it succeeds, it executes some recovery mechanism and frees the lock or proceeds to operate on the objects protected by the lock. The method guarantees recovery from process failures. Furthermore, more sophisticated implementations are provided that apply to queue-based locks where more than one process can cause the lock to be permanently unavailable, as well as implementations that balance the speed of recovery while minimizing the frequency of queries to the programming environment, as these queries may be costly in execution time.
|