資源簡介
進程調度模擬算法(osexperiment完整版)
代碼片段和文件信息
#include
#include
using?namespace?std;
struct?Process//定義進程控制塊
{
char?name[10];//?進程名
int?priority;?//進程優先級
float?arive;?//進程到達時間
float?run;?//進程運行時間
float?start;//進程開始時間
float?finish;?//進程完成時間
float?zz;?//進程周轉時間
float?dqzz;?//進程帶權周轉時間
bool?IsRun;?//進程是否運行標志
};
?
float?finish?=?0.0f;
int?count=0;
void?print(Process?pro[]int?n)//顯示進程
{???
cout<<“原輸入進程信息:“< cout< for(int?i=0;i<=n-1;i++)
{
cout< < }
}
void?fcfs(Process?pro[]int?n1)//先來先服務法
{
????
//先按照提交時間從小到大排列
for(int?i
評論
共有 條評論