US 6,983,461 B2 | ||
Method and system for deadlock detection and avoidance | ||
Gordon Douglas Hutchison, Eastleigh (United Kingdom); and Brian David Peacock, North Baddesley (United Kingdom) | ||
Assigned to International Business Machines Corporation, Armonk, N.Y. (US) | ||
Filed on Feb. 07, 2002, as Appl. No. 10/68,337. | ||
Claims priority of application No. 0118294 (GB), filed on Jul. 27, 2001. | ||
Prior Publication US 2003/0023656 A1, Jan. 30, 2003 | ||
Int. Cl. G06F 9/46 (2006.01) |
U.S. Cl. 718—104 | 18 Claims |
1. A computer implemented method in a virtual machine layer of a computer system supporting multiple processes, said method
including the steps of:
utilizing a set of monitors for controlling access to resources of the computer system, whereby a given process has to enter
a given monitor in order to access a corresponding given resource, and has to join an entry queue for the given monitor if
the given resource is currently owned by another process for which the given process has entered;
responsive to a predetermined condition of a requesting process requesting to enter a requested monitor, from the set of monitors,
currently owned by a different process, examining queued processes queued on at least one of the set of monitors to determine
whether there is a deadlock situation by detecting a cyclic dependency at a time a given dependency is created, wherein the
examination of queued processes queued on the at least one of the set of monitors to determine whether there is the deadlock
situation includes those processes having a conditional wait on at least one of the set of monitors; and
if the deadlock situation is found, returning information about an identity of i) identified processes from the examined queued
processes, and ii) identified monitors from the set of monitors, involved in the deadlock situation with an exception returned
to an application while the application is running on the virtual machine layer of the computer system thereby enabling the
application to resolve the deadlock situation by having at least one of the identified processes release at least one of the
identified monitors that the at least one identified process owns but is not currently using for continued processing by the
application without the deadlock situation.
|