操作系统-进程调度实验.docxVIP

  • 9
  • 0
  • 约8.88千字
  • 约 23页
  • 2019-06-02 发布于浙江
  • 举报
实验五 进程调度模拟实验 //进程调度算法proc.c #include stdio.h #includestdlib.h #include string.h typedef struct pcb //定义PCB结构 { char name[20]; /*进程标识符*/ int cputime; /*进程占用CPU时间*/ int prio; /*进程优先数*/ int needtime; /*进程到完成还需要的CPU时间*/ struct pcb *next;/*链指针*/ }PCB; PCB *RUN,*READY,*RTAIL,*FINSH,*FTAIL; void PRINTLINK(int t)/*输出3个队列*/ { PCB *p; printf(CPU运行次数:___%d___\n,t); printf(______________________\n); printf(进程名\t运行状态\t运行次数\t还需要运行次数\n); if(RUN!=NULL) { printf(%s\t运行\t%d\t%d\n,RUN-name,RUN-cputime,RUN-needtime); } else printf(*运行状态为空\n); p=READY; if(p!=NULL) { while

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档