操作系统实验--死锁的避免程序.docVIP

  • 8
  • 0
  • 约4.44千字
  • 约 6页
  • 2018-03-15 发布于河南
  • 举报
操作系统实验--死锁的避免程序

#includestdio.h #include stdlib.h /*#define n 5//进程总数 #define m 3//资源种类数 */ struct claim { int user;//存放申请的进程 int num[3];//存放申请改进程各类资源的数量 }claims; int alloc[5][3]={{0,1,0},{2,0,0},{3,0,2},{2,1,1},{0,0,2}}; int need[5][3]={{7,4,3},{1,2,2},{6,0,0},{0,1,1},{4,3,1}}; int avail[3]={3,3,2}; output(int i,int work[],int alloc[],int need[],int finish) { printf(\n****************************************************); printf(\n进程 need alloc work finish ); printf(\n%3d* %3d %3d %3d * %3d %3d %3d * %3d %3d %3d *%3d ,i,need[0],need[1],need[2],alloc[0],al

文档评论(0)

1亿VIP精品文档

相关文档