实验五 进程调度模拟实验
//进程调度算法 proc.c
#include <stdio.h>
#include<stdlib.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___",t);
printf("______________________");
printf("进程名 运行状态 运行次数 还需要运行次数");
if(RUN!=NULL)
{
printf("%s 运行 %d %d",RUN->name,RUN->cputime,RUN->needtime);
}
else