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

正文內容

惠州學院操作系統(tǒng)實驗五(編輯修改稿)

2024-08-03 13:53 本頁面
 

【文章內容簡介】 pcbPool[i].prin = 。 pcbPool[i].waittime = 0。 if(readyQueue==NULL) { readyQueue = amp。pcbPool[i]。 readyQueueTail = amp。pcbPool[i]。 } else { readyQueueTailnext = amp。pcbPool[i]。 readyQueueTail = amp。pcbPool[i]。 } if(i++ 9) break。 else puts(Do you want to input more process(y or n): )。 scanf(%s, amp。stop)。 } poolSize = i + 1。 }程序運行截圖如下:任務2:時間片輪轉調度算法模擬輸入一批作業(yè)的進程標識和估計運行時間,由其PCB組成就緒隊列。時間片輪轉調度,系統(tǒng)給就緒隊列的第一個進程分配一個時間片,大小等于n (個時鐘周期),再將它移入運行隊列。注意,時間片的大小要比大多數(shù)進程的估計運行時間短。當時間片結束的時候,要將沒有運行完的進程從運行隊列移到就緒隊列的末尾,再次進行調度。在每次調度時將所有進程的當前情況顯示出來。程序框圖如下:程序源代碼如下:include include typedef struct node{ char name[10]。 //進程標識符 float prin。 //進程的優(yōu)先級 int round。 //進程輪轉的時間片 int needtime。 //進程還需要當CPU時間 int waittime。 //進程進入系統(tǒng)后等待當CPU的時間 char state。 //進程當狀態(tài) struct node *next。 //鏈接指針} PCB。PCB *readyQueue=NULL, *runningQueue=NULL, *finishedQueue=NULL, *finishedQueueTail=NULL, *readyQueueTail=NULL, pcbPool[10]。int poolSize = 0。void createPro()。 //根據(jù)進程標識和估計運行時間,將其PCB插入就緒隊列void insertRunningQueue()。 //將優(yōu)先權最高當進程從就緒隊列移入運行隊列,狀態(tài)改為運行void displayQueue()。 //將所有非結束進程的狀態(tài)和優(yōu)先權信息顯示在屏幕void runPro()。 //讓運行進程執(zhí)行足夠的服務時間int main(int argc, char const *argv[]){ createPro()。 while(readyQueue!=NULL) { insertRunningQueue()。 displayQueue()。 runPro()。 puts()。 } puts(Bye)。 return 0。}void createPro(){ char name[10]。 char stop = 39。y39。 int needtime, i=0。 while(stop==39。y39。) { //獲取用戶輸入進程名 puts(Please input the process name: )。 scanf(%s, name)。 strcpy(pcbPool[i].name, name)。 //獲取用戶輸入進程需要時間 puts(Please input the need of time: )。 scanf(%d, amp。needtime)。 pcbPool[i].needtime = needtime。 pcbPool[i].state = 39。039。 pcbPool[i].next = NULL。 pcbPool[i].prin = 。 pcbPool[i].round = 1。 if(i==0) { readyQueue = amp。pcbPool[0]。 readyQueueTail = amp。pcbPool[0]。 } else { readyQueueTailnext = amp。pcbPool[i]。 readyQueueTail = amp。pcbPool[i]。 } if(i++ 9) break。 puts(Do you want to input more process(y or n): )。 scanf(%s, amp。stop)。 } poolSize = i + 1。}void insertRunningQueue(){ runningQueue = readyQueue。 readyQueue = readyQueuenext。 runningQueuestate = 39。139。}void displayQueue(){ if(readyQueue!=NULL) { PCB pcb = *readyQue
點擊復制文檔內容
法律信息相關推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1