云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > 计算机操作系统课程设计源代码《通用处理机调度演示程序源代码》

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

  • 62 次阅读
  • 3 次下载
  • 2025/5/4 11:12:50

}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\

  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

}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){

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com