Effective resource allocation is crucial in operating systems to prevent deadlocks, especially when resources are limited and non-shareable. Traditional methods like the Banker’s algorithm provide solutions but suffer from limitations such as static process handling, high time complexity, and a lack of real-time adaptability. To address these challenges, we propose the Dynamic Banker’s Deadlock Avoidance Algorithm (DBDAA). The DBDAA introduces real-time processing for safety checks, significantly improving system efficiency and reducing the risk of deadlocks. Unlike conventional methods, the DBDAA dynamically includes processes in safety checks, considerably decreasing the number of comparisons required to determine safe states. This optimization reduces the time complexity to O(n) in the best-case and O(nd) in the average and worst-case scenarios, compared to the O(n2d) complexity of the original Banker’s algorithm. The integration of real-time processing ensures that all processes can immediately engage in safety checks, improving system responsiveness and making the DBDAA suitable for dynamic and time-sensitive applications. Additionally, the DBDAA introduces a primary unsafe sequence mechanism that enhances the acceptability and efficiency of the algorithm by allowing processes to participate in safety checks repeatedly after a predetermined amount of system-defined time. Experimental comparisons with existing algorithms demonstrate the superiority of the DBDAA in terms of reduced safe state prediction time and increased efficiency, making it a robust solution for deadlock avoidance in real-time systems.
Read full abstract