資源簡介
西安電子科技大學 操作系統實驗 頁式存儲管理方案模擬 c++編程
代碼片段和文件信息
#include
#include???????????//文件輸入輸出
#include
#include???//產生隨機數組用
#include?????//產生隨機數組用
#include?
using?namespace?std;
HANDLE?thread;
DWORD?threadID;
int?Memory[256];
int?Job_Empty_Check[5];????????//0表示作業釋放,1表示作業存在
typedef?struct?JOB
{
int?JOBSIZE;??????//作業的大小
int?JOBTIME;??????//作業的執行時間
int?JOB_K_NUM;?????//作業所占頁面數
}JOB;
int?JobSize()?????????????????????????????//隨機產生作業大小8~200?k
{
int?w1;
srand((unsigned)time(NULL));
w1=rand();
w1%=200;
while(w1<=8)
{
w1=rand();
w1%=200;
}
return?w1;
}
int?JobTime()???????????????????????????????//隨機產生作業執行時間10~40?s
{
int?w2;
srand((unsigned)time(NULL));
w2=rand();
w2%=40;
while(w2<=10)
{
w2=rand();
w2%=40;
}
return?w2;
評論
共有 條評論