[理工] [計組]-台大94-資工所

看板Grad-ProbAsk作者 (JOU)時間14年前 (2012/01/27 23:32), 編輯推噓1(105)
留言6則, 1人參與, 最新討論串3/3 (看更多)
(4) Paging avoids the problem of external fragmentation of memory in a multi-programming environment. (5) If a thread generates an exception while inside a critical section protected by a lock, the OS can just kill the thread and release the lock; other threads should be able to continue accessing that critical section without problem. (Assume that locks are implemented by the kernel so that the OS that knows all the locks that any particular thread is holding at any point in time.) 找到的答案是(4)F(5)T (4)應該是T吧 (5)應該是F吧 看前面的討論也是認為(4)T 但(5)也有不少認為是T (5)如果真是T 是為何可以不用管有可能C.S 被執行的程式 是因為(Assume that locks are implemented by the kernel so that the OS that knows all the locks that any particular thread is holding at any point in time.) 這句話的關係嗎? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.45.64.133

01/28 01:42, , 1F
4是T沒錯。5如果考慮reader/writer problem,在兩種情境底
01/28 01:42, 1F

01/28 01:42, , 2F
下會有不同作法。第一種是兩個writer在兩個thread上,這時
01/28 01:42, 2F

01/28 01:43, , 3F
一個execp時,OS可以馬上讓另一個進去寫沒問題。但是如果是
01/28 01:43, 3F

01/28 01:43, , 4F
一個writer execp,另一個thread是reader要讀它寫的資料,
01/28 01:43, 4F

01/28 01:44, , 5F
就會有問題產生。不過這題最麻煩的是它用can描述,所以有可
01/28 01:44, 5F

01/28 01:44, , 6F
能就要寫T(for some case)。
01/28 01:44, 6F
文章代碼(AID): #1F8iEEyQ (Grad-ProbAsk)
文章代碼(AID): #1F8iEEyQ (Grad-ProbAsk)