计算机操作系统课程设计源代码《通用处理机调度演示程序源代码》 联系客服

发布时间 : 星期六 文章计算机操作系统课程设计源代码《通用处理机调度演示程序源代码》更新完毕开始阅读

}else{

markThis=thisP=readyHead;

time=thisP->enterMemoryTime;//当前到达时间 pri=thisP->priority; //当前进程的优先级 while(thisP->next!=NULL){

if(time==thisP->next->enterMemoryTime){//判断之后节点的到达时间是

否与当前一致 }

void release(struct PCB1 *pcb){

struct PCB1 *markP,*f; markP=head; if(pcb!=NULL){

if(pcb==head){

f=head;

head=head->next; free(f);

//删除原单链表的进程节点

}

return markThis;

}

if(prinext->priority){//一致,则判断优先级决定 }

pri=thisP->next->priority;//更改优先级判断条件为下一优先级 markThis=thisP->next; //标记当前节点的下一节点

}else{ }

thisP=thisP->next;

break;

}else{

thisP=head->next; while(thisP!=NULL){

if(pcb==thisP){

f=thisP;

markP->next=thisP->next;

}

}

}

}

free(f); break;

}else{ }

thisP=thisP->next;

markP=thisP;

void releaseR(struct PCB1 *pcb){

struct PCB1 *markP,*f; markP=readyHead; if(pcb!=NULL){ }

if(pcb==readyHead){

f=readyHead;

//删除就绪列表中进程节点

readyHead=readyHead->next; free(f);

}else{ }

thisP=readyHead->next; while(thisP!=NULL){ }

if(pcb==thisP){

f=thisP;

markP->next=thisP->next; free(f); break;

}else{ }

thisP=thisP->next;

markP=thisP;

}

void ListAllPCB(struct PCB1 *h){ }

void printPCB(struct PCB1 *pcb,int a,int b,int c,double d){

printf(\if(pcb!=NULL){

//打印单个数据结果

printFieldP(); if(h==NULL){

printf(\没有进程。\\n\

//打印所有进程

}else{ }

printf(\按任意键继续...\\n\

printf(\

thisP=h;

while(thisP!=NULL){ }

printPCBP(thisP); thisP=thisP->next;

terMemoryTime,pcb->serviceTime); }

void printPCBP(struct PCB1 *pcb){

printf(\

if(pcb!=NULL)

printf(\

}else

printf(\没有进程。\\n\

enterMemoryTime,pcb->serviceTime);

else

}

printf(\没有进程。\\n\

void printField(){

printf(\

//打印表头,以及周转时间

printf(\进程名\\t进程号\\t优先级\\t到达时\\t服务时\\t开始执\\t完成时\\t周转时\\t

带权周\\n\ }

void printFieldP(){ }

//从文件读取数据

void readFromFile(){

FILE *fp; int times; int i=0;

char filePath[20],temp[8]; char name[16]; int pri,emt,st;

*/

进程名 优先级 到达时间服务时间 proc1 2 proc2 2 proc3 3

1 1 2

10 11 2

/*数据格式如下

printf(\

printf(\进程名\\t进程号\\t优先级\\t到达时\\t服务时\\n\printf(\间\\t间\\n\

//打印表头,字段

printf(\间\\t间\\t行时间\\t间\\t间\\t转时间\\n\