第一范文网 - 专业文章范例文档资料分享平台

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

来源:用户分享 时间:2025/7/21 22:46:44 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

}

printf(\输入文件路径:\scanf(\fp=fopen(filePath,\times=timeOfData(fp); ProcessAmount=times-2; while(i

fclose(fp);

if(i==0){ //这是用来接收文本格式第一行的汉字。

fscanf(fp,\fscanf(fp,\fscanf(fp,\fscanf(fp,\

//以下用来接收进程数据

}else{ } i++;

fscanf(fp,\fscanf(fp,\fscanf(fp,\fscanf(fp,\

setNewPCB(name,pri,emt,st);

void setNewPCB(char *name,int pri,int entime,int sertime){//赋值建立PCB,用于从文本中获取数据

if(head==NULL){

head=newP;

newP=(struct PCB1 *)malloc(sizeof(struct PCB1));

}else{

thisP=head;

while(thisP->next!=NULL){

thisP=thisP->next;

}

}

}

thisP->next=newP;

thisP=newP;

thisP->No=SequenceNumber; SequenceNumber++; strcpy(thisP->name,name); thisP->priority=pri;

thisP->enterMemoryTime=entime; thisP->serviceTime=sertime;

thisP->next=NULL;

int timeOfData(FILE *f){ //求取从文本中获取数据的进程数量 }

void Menu(){

int flag=1; int se; while(flag){

//菜单

char temp[20]; int i=0; if(f==NULL){

printf(\文件没有找到。\\n\exit(0);

}else{ }

rewind(f); return i;

while(fgets(temp,20,f)!=NULL){ }

i++;

printf(\ --------------12软工3班 陈宇锋 谈泽宇------------\\n\

printf(\ -- 静态优先权优先算法进程调度

--\\n\

printf(\ ----------------------------------------------\\n\ }

//高响应比调度算法 int N;

struct zgxyb *c; struct zgxyb{

}

printf(\进程调度模拟\\n\printf(\退出\\n\printf(\请选择:\scanf(\fflush(stdin); switch(se){ }

SequenceNumber=1; StartCount=0;

case 1:{ }

break;

buildProcess(); printf(\进程列表:\ListAllPCB(head); run();

//清空缓冲区,用于解决输入字符串发生死循环的问题

case 0:

flag=0; break;

default:

printf(\请输入正确选项。\\n\\n\break;

char name[10]; float arrivetime; float servicetime; float starttime; float finishtime; float zztime; float dqzztime; };

struct zgxyb a[100];

void input(struct zgxyb *p,int N) { int i;

printf(\请分别输入 进程名 到达时间 要求服务时间:\\n例如: a 0 100\\n\for(i=0;i<=N-1;i++) {

printf(\请输入第%d个的进程信息:\\n\

scanf(\} }

void Print(struct zgxyb *p,float arrivetime,float servicetime,float starttime,float finishtime,float zztime,float dqzztime,int N) {int k;

printf(\ printf(\for(k=1;k

{printf(\}

printf(\当前执行进程信息:\\n\

printf(\进程名 到达时间 服务时间 开始执行时间 完成时间 周转时间 带权周转时间\\n\

for(k=0;k<=N-1;k++)

{ printf(\etime,p[k].servicetime,p[k].starttime,p[k].finishtime,p[k].zztime,p[k].dqzztime); }

计算机操作系统课程设计源代码《通用处理机调度演示程序源代码》.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c2c9lt7wr8z9pugm7qnnb9acj39qq6000eh9_6.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top