scanf("%d",&p->ntime);
printf("\n please enter the priority number :");
scanf("%d",&p->priority);
printf("\n");
p->rtime=0;
p->state='w';
p->count=0;
p->link=NULL;
sort();
}
printf("\n please enter the time slice size:");
scanf("%d",&slice);
}
int space()
{
int l=0; PCB* pr=ready;
while(pr!=NULL)
{
l++;
pr=pr->link;
}
return(l);
}
disp(PCB * pr)
{
printf("\nqname \tstate \tcount \tntime \trtime \tpriority \n");
printf("%s\t",pr->name);
printf("%c\t",pr->state);
printf("%d\t",pr->count);
printf("%d\t",pr->ntime);
printf("%d\t",pr->rtime);
printf("%d\t",pr->priority);
printf("\n");
}
check()
{
PCB* pr;
printf("\n **** the current running process is :%s",p->name);
disp(p);
pr=ready;
printf("\n **** the current ready queue state :\n");
while(pr!=NULL)