Re: [理工] [OS]-CPU Scheuduling

看板Grad-ProbAsk作者 (石斛蘭)時間16年前 (2010/03/07 23:07), 編輯推噓3(301)
留言4則, 2人參與, 最新討論串2/2 (看更多)
※ 引述《Lautreamont (Maldoror is dead)》之銘言: : Consider a preemptive priority scheduling algorithm based on : dynamically changing priorities. Larger priority numbers imply : higher priority. When a process is waiting for the CPU (in the : ready queue, but not running), its priority changes at a rate α; : when it is running, its priority changes at a rate β. All processes : are given a priority of 0 when they enter the ready queue. : The parametersαandβcan be set to give many different scheduling : algorithms. : a. What is the algorithm that results fromβ>α> 0? : b. What is the algorithm that results from α<β< 0? : Answer: : a. FCFS 假設有 p1 到 pn 共 n 個 process 依序進入 ready queue p1 先取得執行 且 β>α> 0 所以 p1 的 privrity > p2 > p3 > ... > pn (note that 新進來的是 0) 因此 p1 會先執行完 , 然後接著 p2 以此類推 所以是 FCFS : b. LIFO 假設有 p1 到 pn 共 n 個 process 依序進入 ready queue p1 先取得執行 且 β< 0 則在 p2 進入 ready queue 時因為 p2 的 privrity = 0 > p1 ( p1 的是負的 ) 所以 p2 取得 CPU 執行 , 以此類推 越晚進入 ready queue 的 process , 它的 privrity 會越高 因此是 LIFO -- 人家可不是為了你才這樣做的哦! -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 60.198.35.85

03/07 23:11, , 1F
瞭解了 感謝!
03/07 23:11, 1F

03/07 23:23, , 2F
對了今天OS可插隊的SJF應該是看BURST TIME 進行插隊?
03/07 23:23, 2F

03/07 23:29, , 3F
preemptive的SJF 應該就是SRJF 所以在process到達時
03/07 23:29, 3F

03/07 23:30, , 4F
檢查各process剩餘的時間
03/07 23:30, 4F
文章代碼(AID): #1Bay4eNG (Grad-ProbAsk)
討論串 (同標題文章)
文章代碼(AID): #1Bay4eNG (Grad-ProbAsk)