操作系统课程里 用C语言实现银行家算法。
pathhead->next=path2; status++;
}
path1->next=path2;
path1=path2;
}
finishtemp->stat=1;
}
else
{
for(t=0;t<colum;t++)
alloctemp=alloctemp->next; finishtemp->stat=0;
}
}
else
for(t=0;t<colum;t++)
{
needtemp=needtemp->next; alloctemp=alloctemp->next; }
processtest=0;
worktemp=workhead;
finishtemp=finishtemp->next; }
}
path2->next=NULL;
finishtemp=finihead;
for(temp=0;temp<row;temp++) {
if(finishtemp->stat==0)
{
printf("\n系统处于非安全状态!\n"); exit(0);
}
finishtemp=finishtemp->next; }
printf("\n系统处于安全状态.\n"); printf("\n安全序列为: \n"); do
{