Detecting and causing latent deadlocks in multi-threaded programs
AssigneeInternational Business Machines Corporation
InventorCurt D. Tudor
Life of this patent
Estimating the term…
Abstract
Methods and systems for analyzing multi-threaded programs are provided. The predisposed execution of multi-threaded programs is modified to cause and detect latent deadlocks. When a thread attempts to acquire a synchronization object, it is determined if the synchronization object was previously held by a thread that subsequently acquired another synchronization object while still holding the first. If this occurred, the thread is suspended and may be awakened by a thread that has acquired the synchronization object. The newly awakened thread may then attempt to acquire a synchronization object that is held by the second thread thereby increasing the likelihood that a latent deadlock will be caused and detected.
Claims17
A computer implemented method of analyzing multi-threaded programs, comprising:
- receiving a request from a first thread that holds at least one synchronization object to acquire a synchronization object;
- determining if another thread previously held the synchronization object while acquiring another synchronization object;
- suspending the first thread if another thread previously held the synchronization object while acquiring another synchronization object;
- receiving a request from a second thread to acquire the synchronization object while the first thread is suspended;
- allowing the second thread to acquire the synchronization object;
- and
- awakening the first thread.
A computer program product for analyzing multi-threaded programs, comprising:
- computer code that receives a request from a first thread that holds at least one synchronization object to acquire a synchronization object;
- computer code that determines if another thread previously held the synchronization object while acquiring another synchronization object;
- computer code that suspends the first thread if another thread previously held the synchronization object while acquiring another synchronization object;
- computer code that receives a request from a second thread to acquire the synchronization object while the first thread is suspended;
- computer code that allows the second thread to acquire the synchronization object;
- computer code that awakens the first thread;
- and
- a computer readable medium that stores the computer codes.
Dependencies are inferred from the claim text.