91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡(jiǎn)介

連續(xù)存儲(chǔ)空間管理仿真系統(tǒng),操作系統(tǒng),課設(shè),存儲(chǔ)空間

資源截圖

代碼片段和文件信息

#include
#include
#include???????//?就是需要引用這個(gè)圖形庫(kù)
#include?
#include
#define?Count?7
#define?MAXSIZE?32
long?CLK;//模擬時(shí)鐘信號(hào)
int?a[]={881616163232};
////////////////////////////////////////////////////////////////////////////////////////////////
//PCB表的結(jié)構(gòu)和初始化
typedef?struct?PCB{
int?sign;
int?data;
long?start;
int?time1;
struct?PCB?*next;
}*pcb;

typedef?struct?{
pcb?front;
pcb?rear;
}Pcb_head;

Pcb_head?ZZ;

void?Init_pcb()
{
ZZ.front=ZZ.rear=NULL;
int?datatime1name;
long?start;

srand((unsigned)time(NULL));??//確保隨機(jī)
int?num;
num=rand()%13+7;
for(int?j=1;j<=num;j++)
{

cout<<“進(jìn)程名“<<“??“<<“申請(qǐng)內(nèi)存“<<“??“<<“進(jìn)入時(shí)間“<<“??“<<“持續(xù)時(shí)間“< cout<<“???“< data=rand()%1024+1;
cout< start=rand()%9+1;
cout< time1=rand()%9+1;?
cout<
pcb?o=(pcb)malloc(sizeof(PCB));
o->sign=j;
o->data=data;
o->time1=time1;
o->start=start;

if(ZZ.front==NULL)
ZZ.front=ZZ.rear=o;
ZZ.rear->next=o;
o->next=NULL;
ZZ.rear=o;
}
}

void?Init_pcb2()
{
ZZ.front=ZZ.rear=NULL;
int?datatime1name;
long?start;

srand((unsigned)time(NULL));??//確保隨機(jī)
int?num;
num=rand()%13+7;
for(int?j=1;j<=num;j++)
{

cout<<“進(jìn)程名“<<“??“<<“申請(qǐng)內(nèi)存“<<“??“<<“進(jìn)入時(shí)間“<<“??“<<“持續(xù)時(shí)間“< cout<<“???“< data=rand()%32+1;
cout< start=rand()%6+1;
cout< time1=rand()%6+1;?
cout<
pcb?o=(pcb)malloc(sizeof(PCB));
o->sign=j;
o->data=data;
o->time1=time1;
o->start=start;

if(ZZ.front==NULL)
ZZ.front=ZZ.rear=o;
ZZ.rear->next=o;
o->next=NULL;
ZZ.rear=o;
}
}
/* while(1)
{
cout<<“輸入進(jìn)程名、占用空間、起始時(shí)間、持續(xù)時(shí)間。(進(jìn)程名輸入0退出)“< cin>>name;
if(name==0)
break;
cin>>data>>start>>time;
if(data>1024)
{
cout<<“所輸入的數(shù)值大于最大內(nèi)存空間!!“< exit(-1);
}
pcb?o=(pcb)malloc(sizeof(PCB));
o->sign=name;
o->data=data;
o->time=time;
o->start=start;

if(ZZ.front==NULL)
ZZ.front=ZZ.rear=o;
ZZ.rear->next=o;
o->next=NULL;
ZZ.rear=o;
}*/
////////////////////////////
//后備等待隊(duì)列的定義與初始化
typedef?struct?node{
int?sign;
int?data;
int?time1;
struct?node?*next;
}*Queue;
typedef?struct{
Queue?front;
Queue?rear;
}Queue_head;

Queue_head?WW;

void?Init_queue()
{
WW.front=WW.rear=NULL;
}
////////////////////////////////////////////////////////////////////////////////////////////////
//就緒隊(duì)列和物理空間模擬隊(duì)列的定義與初始化
typedef?struct?Pnode{//內(nèi)存塊結(jié)點(diǎn)
int?data;
int?sign;?????????//進(jìn)程名
int?address;
int?time1;???//持續(xù)時(shí)間
struct?Pnode?*pre;??//指向前結(jié)點(diǎn)
struct?Pnode?*next;
}*QueuePtr;

typedef?struct{???????//頭結(jié)點(diǎn)
QueuePtr?front;
QueuePtr?rear;
}linkQueue;

linkQueue?FFFF_fenpei;
QueuePtr?FF_next_ff;
int?m_FF_Count=0;??//已分配的進(jìn)程數(shù)
int?m_FF_Total=0;??//已分配的分區(qū)容量

void?Init_ff()
{
FF_fenpei.front=FF_fenpei.rear=NULL;

評(píng)論

共有 條評(píng)論

相關(guān)資源