Patent ID: 8868755

Claim:
A computer-implemented method for managing locks on shared resources in a distributed computer system comprising: receiving at a first primary computer node a first local lock state from a first secondary computer node of a plurality of secondary computer nodes, wherein the first local lock state provides an amalgamated representation of lock states of one or more tasks on the first secondary computer node and comprises a lock request for access to a shared resource by one or more tasks on the first secondary computer node, a requested lock mode for the lock request, and merged state information of tasks on the first secondary computer node waiting for or holding locks on shared resources, and wherein the merged state information indicates a group lock mode generated by comparing lock modes of the tasks on the first secondary computer node waiting for or holding locks on the shared resources and identifying a lock mode compatible with each of the lock modes of the tasks as the group lock mode based on the comparing; at the first primary computer node, if the first local lock state is not stale, granting the lock request if no conflicts exist, and otherwise adding the first local lock state to a priority queue for the shared resource requested in the lock request and processing the priority queue for the shared resource requested in the lock request; at the first primary computer node, generating a first global lock state in response to the first local lock state, wherein the first global lock state comprises a holdable lock mode that is granted to the first secondary computer node for the shared resource requested in the lock request and merged state information of the plurality of secondary computer nodes with respect to the lock request; communicating the first global lock state from the first primary computer node to the first secondary computer node; at a global deadlock detector, receiving and storing lock conflict information from two or more of the plurality of secondary computer nodes, wherein for each of the two or more secondary computer nodes the lock conflict information comprises local lock waits and lock interests for one or more tasks on that secondary computer node; at the global deadlock detector, detecting a global deadlock using the received lock conflict information, wherein a global deadlock is a deadlock between tasks on two or more different ones of the plurality of secondary computer nodes; at the global deadlock detector, resolving the detected global deadlock by selecting one of the deadlocked tasks as a victim; and communicating the victim selection from the global deadlock detector to the secondary computer node where the selected victim task is located.