操作系统课程设计进程调度算法模拟

上传人:鲁** 文档编号:553396457 上传时间:2022-10-23 格式:DOC 页数:13 大小:367KB
返回 下载 相关 举报
操作系统课程设计进程调度算法模拟_第1页
第1页 / 共13页
操作系统课程设计进程调度算法模拟_第2页
第2页 / 共13页
操作系统课程设计进程调度算法模拟_第3页
第3页 / 共13页
操作系统课程设计进程调度算法模拟_第4页
第4页 / 共13页
操作系统课程设计进程调度算法模拟_第5页
第5页 / 共13页
点击查看更多>>
资源描述

《操作系统课程设计进程调度算法模拟》由会员分享,可在线阅读,更多相关《操作系统课程设计进程调度算法模拟(13页珍藏版)》请在金锄头文库上搜索。

1、 99计算机(2)班 戴虎 99031045 操作系统课程设计 -进程调度算法模拟一、 实验内容:模拟五种进程调度算法并计算各参数值二、 实验原理:(1) 先来先服务调度:最先到达的进程先进行调度(2) 短作业优先调度:从已到达的进程中选出最短的进程优先调度(3) 时间片轮转调度:每个进程依次的按时间片轮流的方式执行(4) 静态优先权调度:赋予优先权,在已到达的进程中选出优先权最高的优先调度(5) 高响应比优先调度:优先权随等待时间而增加,从而使等待时间较长且服务时间较短的进程优先调度响应比=1+等待时间/服务时间三、 实验设计说明:本程序采用C+ Builder 5编程和设计界面考虑到调度算

2、法较多,采用了多页面的界面(如下图),加入的进程限制五个,在文本框中模拟到达一进程后,输入到达时间和服务时间,点击“加入新进程”即可,输入完成之后,点击运行即可得到表中各值。想从新输入可点击“清除”按钮。关闭时直接点击“”即可。该程序还不是很完善,有一些小问题,尚待解决,还得向老师请教。 四、 实验结果:(只打印两个结果示范)运行后操作面板初始化如下图: 短作业优先结果如图:时间片轮转结果如图:(书上的例题)五、 实验源程序:/-#ifndef Unit1H#define Unit1H/-#include #include #include #include #include #include

3、 #include /-class TForm1 : public TForm_published:/ IDE-managed Components 共13页 第13页TPageControl *PageControl1;TTabSheet *TabSheet1;TTabSheet *TabSheet2;TTabSheet *TabSheet3;TTabSheet *TabSheet4;TabSheet *TabSheet5; TStringGrid *sgr;TButton *Button1;TButton *Button2;TButton *Button3;TStringGrid *sgr

4、1;TButton *Button4;TButton *Button5;TButton *Button6;TStringGrid *sgr2;TButton *Button7;TButton *Button8;TButton *Button9;TStringGrid *sgr3;TButton *Button10;TButton *Button11;TButton *Button12;TStringGrid *sgr4;TButton *Button13;TButton *Button14;TButton *Button15;TLabel *Label1;TEdit *Edit1;TLabel

5、 *Label2;TEdit *Edit2;TEdit *Edit3;TEdit *Edit4;TLabel *Label3;TLabel *Label4;TEdit *Edit5;TLabel *Label5;TLabel *Label6;TEdit *Edit6;TLabel *Label7;TEdit *Edit7;TLabel *Label8;TLabel *Label9;TLabel *Label10;TEdit *Edit8;TEdit *Edit9;TEdit *Edit10;TLabel *Label11;TLabel *Label12;TEdit *Edit11;TEdit

6、*Edit12;void _fastcall FormCreate(TObject *Sender);void _fastcall Button3Click(TObject *Sender);void _fastcall Button1Click(TObject *Sender);void _fastcall Button2Click(TObject *Sender);void _fastcall Button6Click(TObject *Sender);void _fastcall Button5Click(TObject *Sender);void _fastcall Button4Cl

7、ick(TObject *Sender);void _fastcall Button9Click(TObject *Sender);void _fastcall Button7Click(TObject *Sender);void _fastcall Button8Click(TObject *Sender);void _fastcall Button12Click(TObject *Sender);void _fastcall Button10Click(TObject *Sender);void _fastcall Button11Click(TObject *Sender);void _

8、fastcall Button15Click(TObject *Sender);void _fastcall Button13Click(TObject *Sender);void _fastcall Button14Click(TObject *Sender);private:/ User declarationspublic:/ User declarations _fastcall TForm1(TComponent* Owner);/-extern PACKAGE TForm1 *Form1;/-#endif */-#include #pragma hdrstop#include Un

9、it1.h/-#pragma package(smart_init)#pragma resource *.dfmTForm1 *Form1;float super6; /优先权float come6; /到达时间float serve6; /服务时间float begin6; /开始执行时间float end6; /完成时间float all6; /周转时间float dall6; /带权周转时间float max(float,float,float);/-_fastcall TForm1:TForm1(TComponent* Owner) /初始化表格 : TForm(Owner)/-voi

10、d _fastcall TForm1:FormCreate(TObject *Sender)sgr-Cells00=进程名;sgr1-Cells00=进程名;sgr2-Cells00=进程名;sgr3-Cells00=进程名;sgr4-Cells00=进程名;sgr3-Cells01=优先权;sgr-Cells01=到达时间;sgr1-Cells01=到达时间;sgr2-Cells01=到达时间;sgr3-Cells02=到达时间;sgr4-Cells01=到达时间;sgr-Cells02=服务时间;sgr1-Cells02=服务时间;sgr2-Cells02=服务时间;sgr3-Cells0

11、3=服务时间;sgr4-Cells02=服务时间;sgr-Cells03=开始执行时间;sgr1-Cells03=开始执行时间;sgr3-Cells04=开始执行时间;sgr4-Cells03=开始执行时间;sgr4-Cells04=等待时间;sgr4-Cells05=响应比;sgr-Cells04=完成时间;sgr1-Cells04=完成时间;sgr2-Cells03=完成时间;sgr3-Cells05=完成时间;sgr4-Cells06=完成时间;sgr-Cells05=周转时间;sgr1-Cells05=周转时间;sgr2-Cells04=周转时间;sgr3-Cells06=周转时间;sgr4-Cells07=周转时间;sgr-Cells06=带权周转时间;sgr1-Cells

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 办公文档 > 工作计划

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号