摘要 |
One embodiment of the present invention provides a system that detects cycles in a set of dependencies between a set of resources in a computer system. The system operates by receiving a new dependency indicating that a first resource cannot proceed unless a second resource is able to proceed. The system determines if the new dependency creates a cycle in the set of dependencies by performing a search, which looks for cycles of dependencies starting from the first resource and ending at the first resource. If the search detects such a cycle, the system indicates that the new dependency creates the cycle. The system may also send an error message when the cycle is detected, and may abort further processing. In one embodiment of the present invention, the new dependency between the first resource and the second resource indicates that the second resource must be started before the first resource is started. In one embodiment of the present invention, the new dependency between the first resource and the second resource indicates that the first resource must be stopped before the second resource is stopped.
|