进程调度源程序.docVIP

  • 14
  • 0
  • 约5.14千字
  • 约 6页
  • 2018-04-02 发布于重庆
  • 举报
进程调度源程序

/进程调度源程序/ #include stdio.h #include stdlib.h #include string.h typedef struct node { ?? char name[10];? /*进程标识符*/ ?? int prio;?? /*进程优先数*/ ?? int round;? /*进程时间轮转时间片*/ ?? int cputime; /*进程占用CPU时间*/ ?? int needtime; /*进程到完成还要的时间*/ ?? int count;? /*计数器*/ ?? char state; /*进程的状态*/ ?? struct node *next; /*链指针*/ }PCB; PCB *finish,*ready,*tail,*run; /*队列指针*/ int N; /*进程数*/ /*将就绪队列中的第一个进程投入运行*/ firstin() { ?? run=ready;?? /*就绪队列头指针赋值给运行头指针*/ ?? run-state=R;?? /*进程状态变为运行态*/ ?? ready=ready-next;? /*就绪对列头指针后移到下一进程*/ } /*标题输出函数*/ void prt1(char a) { ?? if(toupper(a)==P) /*优先数法*/ ????? printf(? name???? cp

文档评论(0)

1亿VIP精品文档

相关文档