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

正文內(nèi)容

操作系統(tǒng)的進(jìn)程調(diào)度實(shí)驗(yàn)報(bào)告-文庫吧在線文庫

2025-09-06 10:22上一頁面

下一頁面
  

【正文】 f(有請(qǐng)求輸入輸出)——掛起程序,即時(shí)間片自增,但是進(jìn)程需要運(yùn)行的時(shí)間,還有優(yōu)先級(jí)均不變。 state process。 int i=0。 //初始化隨機(jī)數(shù)種子發(fā)生器 while (iproc) { q=(struct pcb *)malloc(sizeof(pcb))。 t=q。 coutpcputime。break。amp。 while(q) { if (qprocess!=Finish) { //未完成的進(jìn)程置Ready,完成的進(jìn)程置Finish qprocess=Ready。 if(tpriority0) tpriority=0。 char key。 cpuexe(p)。 getch()。 while(proc1 || proc10){ coutendlYour process is out of order,please try again!endlendlInput Process Number(110): 。 srand((unsigned)time(NULL))。 if (i==0){ //尾插法建立PCB節(jié)點(diǎn) p=q。 } p=pnext。 do { t=tnext。 } } return t。 coutpround。 } p=pnext。 coutCPUTime:cpuendl。 coutCPUTime:cpuendl。 cout2 Round Robinendl。:priority_cal()。:exit(0)。:round_cal()。 display_menu()。 if(key==39。 r=p。 p=get_process_round()。 case Working:cout\b\bWorkingendl。 coutpcputime。 if(t==NULL) { t=head。 } qround++。 } i++。 qcputime=0。 while(timepiece1 || timepiece5){ coutendlIllegal Input!endlendlCPU TimePiece(15)?。 pcb *p。 if(key==39。 coutendl。 }}void priority_cal(){ //優(yōu)先數(shù)算法主控函數(shù) pcb *p。qprocess!=Finish) { //找到下一個(gè)優(yōu)先數(shù)最高且未完成的進(jìn)程 tp=qpriority。 q=qnext。break。 if(pneedtime==0) coutDone。 } //while return p。 qpriority=rand()%100。 cinproc。pcb *get_process(){ //優(yōu)先數(shù)算法輸入進(jìn)程個(gè)數(shù) int proc。 int priority。//占用CPU的時(shí)間片數(shù) int at。在P算法中,優(yōu)先級(jí)每次減少的數(shù)也很關(guān)鍵,若是過小了,不能達(dá)到照顧低優(yōu)先級(jí)的小進(jìn)程的作用,若是過大了,優(yōu)先級(jí)這個(gè)屬性的作用就不明顯了。 RR算法: 在輸入了進(jìn)程數(shù)3,時(shí)間片大小3之后,由srand()函數(shù)給出每個(gè)函數(shù)的needtime。每過一個(gè)時(shí)間片,運(yùn)行進(jìn)程占用處理機(jī)的時(shí)間片數(shù)加1,然后比較占用處理機(jī)的時(shí)間片數(shù)是否與該進(jìn)程的輪轉(zhuǎn)時(shí)間片數(shù)相等,若相等說明已到達(dá)輪轉(zhuǎn)時(shí)間,應(yīng)將現(xiàn)運(yùn)行
點(diǎn)擊復(fù)制文檔內(nèi)容
研究報(bào)告相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1