Method and apparatus for detecting deadlocks
AssigneeMicrosoft Corporation
InventorFabian Toader
Life of this patent
Estimating the term…
Abstract
A procedure identifies multiple threads associated with a process and pauses execution of a first thread associated with the process. A determination is made regarding whether the first thread is attempting to access a first resource. If the first thread is attempting to access a first resource, the procedure identifies a second thread that has locked the first resource and determines whether the second thread is attempting to access a second resource that is locked by the first thread. A deadlock is identified if the second thread is attempting to access a second resource that is locked by the first thread.
Claims20
A method comprising:
- identifying a plurality of threads associated with a process;
- pausing execution of a first thread associated with the process;
- determining whether the first thread is attempting to access a first resource;
- if the first thread is attempting to access a first resource:
- identifying a second thread associated with the process, wherein the second thread has locked the first resource;
- determining whether the second thread is attempting to access a second resource that is locked by the first thread;
- and
- identifying a deadlock if the second thread is attempting to access a second resource that is locked by the first thread.
One or more computer-readable media having stored thereon a computer program that, when executed by one or more processors, causes the one or more processors to:
- determine whether a first thread in a process is associated with a critical section;
- if the first thread is associated with a critical section:
- identify a second thread associated with the process;
- determine whether the second thread has locked a first resource associated with the critical section;
- if the second thread has locked a first resource associated with the critical section:
- determine whether the second thread is attempting to access a second resource that is locked by the first thread;
- and
- identify a deadlock if the second thread is attempting to access a second resource that is locked by the first thread.
An apparatus comprising:
- a first resource;
- a second resource;
- and
- a deadlock detector coupled to the first and second resources, the deadlock detector to identify multiple threads executing on the apparatus and to determine whether a first thread is attempting to access the first resource, wherein if the first thread is attempting to access the first resource, the deadlock detector:
- identifies a second thread that has locked the second resource, determines whether the second thread is attempting to access the second resource that is locked by the first thread, and identifies a deadlock if the second thread is attempting to access the second resource.
Dependencies are inferred from the claim text.