看板 Grad-ProbAsk 關於我們 聯絡資訊
這是恐龍第八版的習題 (ch5 process scheduling) 5.16 Consider a preemptive priority scheduling algorithm based on dynamically changing priority. Larger priority numbers imply higher priority. When a process is waiting for the CPU (in the ready, but not running), its priority changes at rate A; when it is running. its priority changes at a rate B. All processes are given a priority of 0 when they enter the ready queue. The parameter A and B can be set to give many different scheduling algorithm. a. What is the algorithm that result form B > A > 0 b. What is the algorithm that result form A < B < 0 a.的部分我想就是FCFS 沒什麼問題 我想問問看大家對於b.看法是什麼 (我自己是覺得有點像後進先出) -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 111.251.226.206
witz:你知道題目問的是scheduling algo而不是問你依什麼方式達成嗎 10/30 23:36
witz:FCFS在這裡只是用來描述algo使用的原則 10/30 23:41
christianSK:不好意思 我不太懂樓上的意思 10/31 00:17
christianSK:我想題目在問這樣的情況會形成那一種algo 10/31 00:19
christianSK:b的部分我覺得是後進先出 所以我不知道該歸為哪個algo 10/31 00:20
hunter0904:我連題目都看不懂= = 它是有一個變動的rate? 10/31 01:08
hunter0904:這樣要怎麼看是FCFS?樓上大大可以教一下嗎 10/31 01:09
hunter0904:我看到答案 第二個是LIFO沒錯 10/31 01:09
(可以先問一下答案是在哪看到的嗎? XD ) 因為題目先假設每個進入系統中的process的起始priority都是0 而進入系統中之後 ready queue中的process priorty 會以rate A的速率增加(減少) 得到CPU執行的process則以rate B的速率增加(減少) 第一個問題 因為 0 < A < B 所以進入系統之後 process priority就會大過 0 越早進來的越高 拿到CPU的一定是因為他在ready queue時priority 最高 拿到CPU之後又比其他process增加的要快 所以沒有其他process可以從他手中拿走CPU 這樣就會形成FCFS ※ 編輯: christianSK 來自: 111.251.226.206 (10/31 01:15)
hunter0904:謝囉 我是看第七版的習題解答有這題 你有需要在站內信 10/31 08:29