作者DiLegend (JOU)
看板Grad-ProbAsk
標題[理工] [計組]-台大94-資工所
時間Fri Jan 27 23:32:27 2012
(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
推 wheels:4是T沒錯。5如果考慮reader/writer problem,在兩種情境底 01/28 01:42
→ wheels:下會有不同作法。第一種是兩個writer在兩個thread上,這時 01/28 01:42
→ wheels:一個execp時,OS可以馬上讓另一個進去寫沒問題。但是如果是 01/28 01:43
→ wheels:一個writer execp,另一個thread是reader要讀它寫的資料, 01/28 01:43
→ wheels:就會有問題產生。不過這題最麻煩的是它用can描述,所以有可 01/28 01:44
→ wheels:能就要寫T(for some case)。 01/28 01:44