freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內容

操作系統(tǒng)課程設計(小型的操作系統(tǒng))-在線瀏覽

2024-09-15 08:44本頁面
  

【正文】 寫映射表相當?shù)睦щy,一度想改用Java語言,在于對C++語言的了解不夠。8. 源代碼includeiostreamincludecstringincludeincludecstdlibinclude //循環(huán)隊列的頭文件using namespace std。int UsedMAXDISKMEM=0。 int DynReg=0。//進程的名字 int ArriveTime。//此進程所需要的時間 int NeedMem。//用于指示是何種操作 int NeedTranDataNum。//計算類型的操作所需的cpu時間 //假設others不需要其他的各個操作。//需要資源的數(shù)目 NULL代表不需要使用 0——a.... Process *next。class JOB{ Process *p。 Process *head1。 //wait 為等待鏈表 running是正在運行的進程 public: JOB(){ head1=p=head=NULL。 Sleep(2000)。 int n。s process num.endl。 while(n){ p=new Process()。 cinpProcessName。 cinpArriveTime。 cinpNeedCpuTime。 cinpNeedMem。t not accept your job! Maybe your job is too large! Please enter a num 128endl。 } coutplease enter the operation of to TranDiskNum ,1 to cpuendl。 cinnn。 cinpNeedTranDataNum。 }else{ coutplease enter the OpCpus.endl。 pOpKind=Calculate。 for(int i=0。i++){ cinpNeedRescourse[i]。//尾結點為空 表示 一個節(jié)點的完成 下面進行插入鏈表的工作 head=SortLinkTable(head,p)。 }//while LinkCopy()。//檢查重名現(xiàn)象 } void Provide_Same_Process_Name()。 Process* SortLinkTable(Process*,Process*)。 void ShowProcessInfo()。 void DeedLock_KillProcess()。 void LookCpu()。 void LookMem()。 void ShowRunningProcess_CalculateCpuNeed(int*,int)。 void LookMem_ChangeMem()。 void LookDiskMem_Change()。 void MemToDiskMem()。 delete head1。 } }。//設置全局變量 void JOB::Provide_Same_Process_Name(){ system(cls)。 Process *temp=head1。 while(temp){ temp1=tempnext。 coutThis System can39。 coutThis is ALL your process name:endl。 coutEnter 1 to rename the former,0 to rename the later!endl。 cinn。 if(n==0){ cinbuffer。 }else{ cinbuffer。 } }//end if temp1=temp1next。 }//while}void AgainEnterJOB(){ system(cls)。 job=new JOB()。 head1=head1next。}void JOB::LinkCopy(){ Process *temp=NULL,*temp2=head。 } if(head1)//不為空時 將其下一個置為空 head1next=NULL。 while(temp2){ //apply a new node temp=new Process()。 tempArriveTime=temp2ArriveTime。 tempNeedMem=temp2NeedMem。 tempNeedTranDataNum=temp2NeedTranDataNum。 tempOpCpus=temp2OpCpus。i3。 } //apply end tempnext=NULL。 if(head1==NULL){ head1=temp。 while(knext){//尋找到最后一個節(jié)點 不斷的循環(huán)退不出去 k=knext。 } // coutcopy is right!endl。 }//while if(head1==NULL) coutLinkCopy() is out!endl。}void JOB::MemToDiskMem(){ system(cls)。 //一共定義的16個頁面 (e)。 int count=0。 while(temp_head1){ count++。 } temp_head1=head1。 int temp_count=0。 coutProcess: temp_head1ProcessName memery use situation:endl。 int k=0。 }else{ k=Begin/YE+1。 coutk頁被占用!endl。 }//end while coutendl。 coutWant to see 缺頁調度過程 Y/N. endl。 int total=0,AllTotal=0。 if(option==39。||option==39。){ for(int i=0。i++){ AllTotal+=Mem[i]。jMem[i]。 while(temp_counti){ temp_head1=temp_head1next。 } coutProcess :temp_head1ProcessName need mem is endl。 }else{ temp_count=0。 temp_count++。 temp_head1=head1。 bool flag=()。 } } }//for2 coutendl。 system(pause)。 int NowTime=0。//臨時試用一下 最終需要歸還為NULL Process *wait=head1。 while(run){//計算等待運行的進程的個數(shù) count++。 } run=head1。//申請一個動態(tài)的二維表 for(int i=0。i++){//響應的二維空間申請完畢 Run_Process_Name[i]=new char[10]。 run=runnext。 int *Run_Process_CpuNeed=new int[count]。 Process *priorNode=NULL。 while(true){ //int time11=waitArriveTime。amp。 priorNode=run。 while(tempnext!=priorNode){//尋找到前驅節(jié)點 temp=tempnext。//將結點連接上鏈表 priorNode=wait。 } wait=waitnext。//連接上頭部形成 循環(huán)鏈表 } if(run){ run=runnext。 coutcpu 調度下一個運行的進程。 NowTime+=RR。 for(int i=0。i++){ if(strcmp(Run_Process_Name[i],runProcessName)==0) break。 ALLNeedCpu=RR。//重新寫回到數(shù)組中 保持一致性 }else{ //此節(jié)點已經(jīng)做完了 請直
點擊復制文檔內容
規(guī)章制度相關推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1