摘要
由于计算机系统资源具有某些特性,将会导致多进程并发时产生资源的竞争,银行家算法是避免死锁的一种有效方法,能提前预测系统是否处于安全状态。银行家算法利用系统可用资源向量、最大需求矩阵、已分配资源矩阵、还需矩阵4种数据结构来进行资源分配。本文采用C语言编程,设计并实现了银行家算法。通过仿真实验证明,该算法在一定程度上能有效的避免死锁产生。
Some resources of computer system have some characteristics, such as exclusivity, which will lead to resource competition when multiple processes are concurrent. Banker algorithm is an effective method to avoid deadlock and can predict whether the system is in a safe state in advance. Banker algorithm uses some data structures, such as system available resource vector, maximum demand matrix, to allocate resources. The banker algorithm is designed and implemented in C language. The simulation results show that the algorithm can effectively avoid deadlock to a certain extent.
作者
刘璇
LIU Xuan(Department of Information Engineering,Guiyang Institute of information technology,Guiyang 550025,China)
出处
《智能计算机与应用》
2022年第7期206-209,I0002,共5页
Intelligent Computer and Applications
关键词
多进程
银行家算法
安全序列
死锁
multi process
banker algorithm
safety sequence
deadlock