主题:[讨论]紧急啊,这个调度系统出现了系统问题,哪位高手帮忙一下,求斑主给其加分
//--------------------------------------------------------------------------
void getnewqueue_fun(PCB P[MAXP],int n,PCB *H[3],int time,int isstop,int d)
{ /*获得新就绪队列*/
static int now=0;
int i;
PCB *q,*q1,*q2;
for(i=now;i<n;i++) /*将已提交进程插入就绪队列*/
[color=FF0000][/color][size=4]if((P[i].arrive)<=time)
{ now++;
if(H[P[i].grade]==NULL)
H[P[i].grade]=&P[i];
else{q=H[P[i].grade];
while(q->next!=NULL)
q=q->next;[/size] q->next=&P[i];
}
}
if(isstop==1) /*进程已运行完*/
H[d]=H[d]->next;
if(isstop==0) /*进程未运行完*/
{if(H[d]->next!=NULL)
{q1=H[d];
q2=q1->next;
while(q2!=NULL&&(q2->arrive<time||(q2->arrive==time&&q2->serve<H[d]->serve)))
{q1=q1->next;
q2=q1->next;
}
if(q2==NULL)
{q=H[d];
q1->next=q;
H[d]=H[d]->next;
q->next=NULL;
}
else if(q1!=NULL)
{q=H[d];
q1->next=q;
H[d]=H[d]->next;
q->next=q2;
}
}
}
}
出现在红字处,当输入NAME... 后出现了ACCESS VIOLATION的错误