2022年操作系统调度算法 .pdf





《2022年操作系统调度算法 .pdf》由会员分享,可在线阅读,更多相关《2022年操作系统调度算法 .pdf(10页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、南京信息工程大学实验(实习)报告实验(实习)名称调度算法日期 2011.4.17 得分指导教师毕硕本学院计算机与软件学院专业 软件工程年级 09 班次 2 姓名徐赵飞学号 20091344071 一、实验题目选择五个调度算法,设计实现处理机调度的程序。二、实验目的用简单的程序实现不同算法,即先来先服务算法,最短作业优先算法,轮转调度算法,优先级调度算法和彩票调度算法五种。体现各种算法的实现方式和优缺点,了解不同算法的工作优先级,比较各种算法的不同。三、实验设备及环境:1.硬件设备: PC 机一台。2.软件环境: Windows 操作系统,并安装C+编程语言环境。四、实验内容及要求:用 C+语言
2、实现对多个进程采用多种调度算法执行的模拟(本次实验采用的是:先到先服务算法、优先级调度算法、最短作业优先算法、轮转调度算法和彩票调度算法来实现的。)五、源程序#include #include #include using namespace std; typedef struct run int time; /运行时间int i; /优先级int start; /到达系统时间int wait; /无用数据char data; /数据struct run *next; run,*Run; class System private: Run R; Run N; Run Y; Run L; Run
3、 S; public: void FCFS(); void SJF(); void RR(); void YXJ(); /优先级调度void TICKET(); 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 1 页,共 10 页 - - - - - - - - - ; /*FSFC*/ void System:FCFS() Run p,r; char x1; int flag,x2,x3,x4,x5=0,x6=1,x7=0,x8,x9; float sum100; sum0=0;
4、R=new run; R-next=NULL; r=R; coutplease put in flagflag; coutplease put in !data! time! i! start !wait !flag!x1; cinx2; cinx3; cinx4; cinx9; cinflag; p=new run; p-data=x1; p-time=x2; p-i=x3; p-start=x4; p-wait=x9; r-next=p; r=p; x5+; if(R-next)p=R-next; else p=R; while(x5) sumx6=sumx6-1+(p-time); co
5、utdatanext; x5-; x6+; x6-; x8=x6; x7=0; while(x6) 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 2 页,共 10 页 - - - - - - - - - x7=x7+sumx6; x6-; x7=x7/x8; coutx7endl; coutFCFS!next=NULL; p2=new run; p4=new run; r=N; coutplease put in !flag!flag; coutplease put in !dat
6、a! time! i! start !wait !flag!x1; cinx2; cinx3; cinx4; cinx5; cinflag; p1=new run; p1-data=x1; p1-time=x2; p1-i=x3; p1-start=x4; p1-wait=x5; p2=N; x7=0; while(x7next-timetime) p2=p2-next; x7+; if(x7=x6) r-next=p1; 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 3 页,共
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 2022年操作系统调度算法 2022 操作系统 调度 算法

限制150内