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

正文內(nèi)容

各類作業(yè)調(diào)度算法(參考版)

2025-03-27 23:37本頁面
  

【正文】 }(程序測試運行結(jié)果在附件里)。 cout\n這組作業(yè)的帶權(quán)平均周轉(zhuǎn)時間為: allWi / lengthendl。 display()。 }}int main(){ init()。 pnext = NULL。 psubtime = time。 pstate = 39。 cout\n請輸入作業(yè)優(yōu)先級: 。 cout\n請輸入作業(yè)所需的資源: 。 cout\n請輸入作業(yè)所需的運行時間: 。 cout\n請輸入作業(yè)名: 。 i++) { p = new jobCB。 for(int i = 0。 cout請輸入作業(yè)數(shù): endl。 }}void input(){ int n。//回退 cout沒有足夠資源!endl。 } } length ++。 q2=q2next。 flag=1。 while(q2!=NULL){ if(q2priorityppriority) { pnext=q2。 }else { q1=ready。 } else { if(ppriorityreadypriority) { pnext=ready。//分配資源給作業(yè) jobCB *q1,*q2。}void in_queue(){ int flag=0。 running()。 pstate = 39。 i++) { p = ready。 for(int i=0。 destroy()。 allTi+=Ti。 cout\n錄入時間 運行時間 開始運行的時刻 完成時刻 周轉(zhuǎn)時間 帶權(quán)周轉(zhuǎn)時間 優(yōu)先級endl。//周轉(zhuǎn)時間 double Wi = Ti/pruntime。 double Tc = time+ pruntime。}void running(){ pstate=39。f39。 time+=pruntime。 rail=ready=p=NULL。 maxsource=MAX_SOURCE。 allTi=0。//時鐘void init(){ time=0。//總周轉(zhuǎn)時間double allWi。double now_source。int length。//進(jìn)程狀態(tài) struct jobCB *next。//資源 int priority。//提交時間 double runtime。struct jobCB{ string name。 作業(yè)調(diào)度算法:采用基于優(yōu)先級的作業(yè)調(diào)度。}(程序測試運行結(jié)果在附件里)編寫并調(diào)度一個多道程序系統(tǒng)的作業(yè)調(diào)度模擬程序。 cout\n這組作業(yè)的帶權(quán)平均周轉(zhuǎn)時間為: allWi / lengthendl。 display()。}int main(){ init()。 in_queue()。 time++。w39。 cinpsource。 cinpruntime。 cinpname。 cout當(dāng)前作業(yè)錄入時間:time。 i n。 inputfinishtime=n*1。 cout請輸入作業(yè)數(shù): endl。}void input(){ int n。}bool pare(jobCB *first,jobCB *second) //用于list排序的pare函數(shù){ if(makeout_ResR(first)makeout_ResR(second)) return true。 }}double makeout_ResR(jobCB *p)//算出響應(yīng)比,因為優(yōu)先比是waittime/runtime+1,所以這里直接比較waittime/runtime(inputfinishtimesubtime)/runtime{ //cout(inputfinishtimepsubtime)/pruntime \t。//回退 cout沒有足夠資源!endl。 length ++。}void in_queue()//按所有作業(yè)到達(dá)后再計算響應(yīng)比(即固定優(yōu)先比),所有作業(yè)都提交完成的時間是n*提交單個作業(yè)時間(1){ now_source+=psource。 running()。//出隊 pstate = 39。 i++) { p=()。 for(int i
點擊復(fù)制文檔內(nèi)容
試題試卷相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1