c++写的死锁检测与解除算法,亲测已经运行成功,代码有说明,容易理解
2019-12-21 21:33:01 1KB 银行家算法
1
死锁检测源代码
2019-12-21 21:33:01 3KB 死锁检测算法
1
程序结构清晰,容易入手。死锁检测,MFC界面,操作简单。方便调试。
2019-12-21 21:11:21 6.4MB 操作系统 课程设计 死锁检测
1
原创实测有效的一个c++检测线程死锁的解决方法,已应用于项目,实测有效 原创文章地址:https://blog.csdn.net/liaozhilong88/article/details/80354414
2019-12-21 20:07:54 288KB 线程死锁检测
1
#include using namespace std; const int M = 3; const int N = 5; int Ava[M] = {3, 3, 2}; int All[N][M] = {{0,1,0},{2,0,0},{3,0,2},{2,1,1},{0,0,2}}; int Nee[N][M] = {{7,4,3},{1,2,2},{6,0,0},{0,1,1},{4,3,1}}; int work[N+1][M] = {{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}}; int flag[N][2] = {{0,0},{0,0},{0,0},{0,0},{0,0}}; int count = 0; void Safe(int num); int main() { int num = 0; for (int k = 0; k < M; ++k) { work[num][k] = Ava[k]; } Safe(num); cout << "total: " << count; system("pause"); return 0; } void Safe(int num) { if (num == N) { count++; for (int m = 0; m < N; ++m) { cout << flag[m][1] << " "; } cout << endl; }
2019-12-21 19:43:22 1KB 死锁检测递归
1