[理工] [os] 行程同步

看板Grad-ProbAsk作者 (東京熱死胖子)時間13年前 (2012/12/17 18:34), 編輯推噓3(307)
留言10則, 3人參與, 最新討論串1/1
是非題: 1.System calls are executed with privileged instruction which are not supposed to be used by user program. 2.In practice, the SJF scheduling algorithm may not be optimal in average waiting time. 3.The technology of virtual memory system may fail for some specific CPU instruction sets. 4.The final value of the shared data depends upon which of concurrent processes finish last. 5.Several processes can access and manipulate shared data concurrently, by sharing a code segment. 順便請問一下process fork()後共用code section,不共用data section, 這樣他們算共享address space嗎? 如果是的話是共享code section的address space 還是data section的? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.123.237.64

12/18 00:03, , 1F
FTTFF 不算吧,fork就是兩個互相獨立的行程了,能共享code是因
12/18 00:03, 1F

12/18 00:03, , 2F
為code section 不會被更改,所以共用不影響
12/18 00:03, 2F

12/18 00:19, , 3F
請問第四格為什麼錯
12/18 00:19, 3F

12/18 00:22, , 4F
我覺得是TTTTF
12/18 00:22, 4F

12/18 00:23, , 5F
fork的父子你只說他共享code sec.是可以的
12/18 00:23, 5F

12/18 00:54, , 6F
1.這是97台大電機,老師是說如果which指system call就錯,若是
12/18 00:54, 6F

12/18 00:55, , 7F
指privileged instruction就對,但其他選項都T,而這題是選F
12/18 00:55, 7F

12/18 00:56, , 8F
所以才這樣判斷. 至於第4題,共用資料應保證同步,所以process
12/18 00:56, 8F

12/18 00:56, , 9F
執行順序不影響最終值
12/18 00:56, 9F

12/18 00:58, , 10F
fork不算共享address space,只能說有相同的address space
12/18 00:58, 10F
文章代碼(AID): #1GplKTXG (Grad-ProbAsk)