ALL > Computer and Education > courses > university courses > undergraduate courses > Operating System > ZSTU class(2019-2020-1) > student directories > 2017331200093-解振鑫 >
homework5 Version 0
👤 Author: by 945205359qqcom 2019-11-30 05:58:42
The banker algorithm is a well-known algorithm for avoiding deadlocks. It is an algorithm designed for avoiding deadlocks by T.H.E system designed by Izger Dijkstra in 1965. It judges and guarantees the safe operation of the system based on the allocation strategy of the bank loan system.

example:
void infInput()
{
int i,j;
cout<<"请输入最大需求矩阵max\n";
for(i=0; i<p; i++)
{
for(j=0; j<r; j++)
{
cin>>maxs[i][j];
}
}
cout<<"请输入分配矩阵allocation\n";
for(i=0; i<p; i++)
{
for(j=0; j<r; j++)
{
cin>>allocation[i][j];
}
}
cout<<"请输入需求矩阵need\n";
for(i=0; i<p; i++)
{
for(j=0; j<r; j++)
{
cin>>need[i][j];
}
}
cout<<"请输入可用资源向量available\n";
for(i=0; i<r; i++)
{
cin>>available[i];
}
}

Please login to reply. Login

Reversion History

Loading...
No reversions found.