Modified Banker's algorithm with dynamically release resources
Dan Song, Yadong Li, Tengtao Song · 2021
There are three methods for handling deadlocks in resources allocation systems: deadlock prevention, deadlock avoidance and deadlock detection combined with recovery. Of these three methods, deadlock avoidance is preferable in many cases but seldom used on account of its high cost. The high cost lies not only in the time complexity and space complexity of the algorithm, but also in its limits the concurrency of the system. This paper presents a simple modification of a known deadlock avoidance, the banker's algorithm, which can dynamically release resources during the process running instead of returning all resources after the process is finished. Our method can effectively improve the resource utilization of the system. Experiments demonstrate that the cost time of the modified method is about 10% lower than the banker's algorithm. At worst, processes release no resource during their operation, and our method is nearly as fast as the banker's algorithm.