作者wheels ()
看板Grad-ProbAsk
標題Re: [理工] 模擬考OS
時間Sun Jan 22 11:45:18 2012
※ 引述《jackbll (阿湯)》之銘言:
: 恩...第二次模考的題目 蠻多疑問的
: 第二部分
: part I 選擇
: --------------------------------------
: 3. Monitors 的敘述哪些是對的?
: (D) Monitor can solve more complicated synchornization problem than
: semaphore
: 這個錯了嗎@@? monitor不是改進 semaphore ??
monitor semaphore critical region 三者可以互相製作,能力相同。
: 6. disk bad block 的敘述哪些是錯的?
: (A) bad blocks can be locked away in the corresponding FAT entries for
: some disk with IDE controllers.
IDE controller通常用lock標示bad sector沒錯。
: (B) The controller can be told to replace each bad sector logically with
: one of the spare sectors,This scheme is known as sector sparing.
SCSI controller等用sector sparing就是作這些事沒錯。
: (C) Some controllers can be instucted to replace a bad block by sector
: slipping.
sector slipping就是這樣沒錯。
: (D) The sector stealing technique can map the bad sector to another normal
: sector.Hence,a sector can be referenced with two different sector number
這個有趣了,我上網google完全沒有sector stealing這種東西存在,有人有查到嗎?
: (E) In SCSI,the spare sectors processing will not destroy the optimal
: preform of disk scheduling.
同(B) sector sparing會破壞disk scheduling,所以才會有在每個track上都放一些
spare sector的解法。
: 答案DE 我怎麼沒印象課本有講到 bad block Q口Q
: 7.In Solaris 2,an intermediate level of threads called light weight process
: (LWP) between the user threads and kernel threads ...
: 反正要問關於LWP的敘述哪個是錯的?
: (A)user threads的排程&內文轉換 是thread liberary with little support
: from kernel
no support from kernel.
: (B)一個LWP對映到一個kernel thread
user thread跟LWP是many to many的map,LWP跟kernel thread是one to one map.
: (E)user threads and LWPs are user space data structures, while kernel
: threads are kernel spaces resources.
LWP跟kernel thread都是kernel spaces的。
: 答案(A)(E) 但是我覺得(B)錯了 課本這邊舉了五個不同檔案讀取要求
: 所以五個LWP 都會卡在這個 kernel I/O 感覺很怪 也有可能是我沒讀通
: 麻煩大家了 感恩~~
: 10.C
: http://goo.gl/GTE5r
: 不是reader 和 writer 優先權相同嗎
沒有說的話應該是看ready queue怎麼定的,FIFO和priority都有可能,
這題我問過老師,他也說是錯的。
: 16.3和4
: http://goo.gl/Wtl2N
: http://goo.gl/ft7Hg
S2是cpu很忙,增加degree完全沒用。
S3是cpu utilization不足,增加degree會提高利用率。
: 2.
: http://goo.gl/Z6ki9
把main切成兩個part看if一邊else一邊。
if那邊第一次fork完會變一父一子,各對nested的if敘述式fork一次,
進去後把再生出的兩個兒子當爸爸,每個爸爸連續fork兩次生出生出三個孫子。
所以這個if生出2 + 2 + 2 * 3 = 10。
else那邊main thread會進去,連續作fork兩次生出三個孫子。
所以這邊有1 + 3 = 4,所以總共就14個了。
: 講義上的
: http://goo.gl/MBGkA
: 我想問response time 應該是第一次回應的時間吧
: 感覺應該是藍色比寫的才是對的
沒錯!
其實回這篇是想問,有人聽過sector stealing嗎?感謝:)
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 111.249.8.59
※ 編輯: wheels 來自: 111.249.8.59 (01/22 11:57)
推 AIdrifter:恩.也只有聽過cycle stealing...考試還在想WTF.. 01/22 12:13
推 P568912:我聽洪逸講起來的感覺 它就是sector sparing... 01/22 12:17
→ P568912:只是不知道有沒有根據就是了.... 01/22 12:17
→ wheels:!!是在題庫班說的嗎? 01/22 12:18
→ P568912:沒有 我問他的 01/22 12:21
→ wheels:有種全世界應該就只有他會這題的感覺XD 01/22 12:26
→ P568912:難怪我問他的時候 他笑得很爽XD(誤) 01/22 12:29
推 JiDung:sector sparing會破壞disk scheduling "的performance" 01/22 13:04
→ JiDung:比較安全一點 01/22 13:04