posted on 2023-12-01, 00:00authored byMarco Milani
Deadlocks is a common problem in concurrent programming.
It can cause programs blockage unresponsive and hinder the efficient utilization of hardware capabilities.
The objective of this research is to show a methodology that can effectively identify and resolve deadlocks occurring within real world applications using Java libraries, thereby improving the reliability and performance of software applications.
To achieve this objective,we conducted a comprehensive investigation of Java libraries, leading to the identification of various instances of deadlocks.
We developed specialized drivers to recreate these deadlocks, enabling a thorough analysis of their occurrence and behavior within the libraries.
Subsequently,we used the Deadlock Detector and Solver (DDS) methodology to automatically detect and resolve deadlocks during run-time.
DDS relies on a supervisory controller to monitor program execution and efficiently detect deadlocks caused by hold-and-wait cycles on monitor and reentrant locks.
This autonomous and automatic deadlock detection and resolution process eliminates the need for manual intervention, making it highly efficient.
The technique to resolve a deadlock depends on preempting a lock in the detected deadlock cycle, with the thread holding the lock being called the "victim" thread.
The strategy involves returning the lock to the victim thread once another thread has used it, but requires that one of the threads in the deadlock is suitable to be victimized.
To determine this, a preprocessing technique is employed to identify harmful statements in potential deadlock locations that alter a locked object or a shared object before a second lock is requested by a specified thread.
Experimental results demonstrate the effectiveness and scalability of the DDS methodology.
The average run-time overhead introduced by the DDS approach remains below 7%, ensuring its practicality and viability for real-world deployment.
DDS is scalable and does not incur a noticeable overhead with an increase in the number of synchronization points and threads and it is a promising solution for detecting and resolving deadlocks in Java real world applications.