[作業] Operating_System_Homework6

看板CHU_CS96b作者 (木頭)時間15年前 (2010/05/19 22:00), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串1/1
6-1. The first known correct software solution to the critical-section problem for two processes was developed by Derek Fisher. The two process, P0 and P1 ,shared the following variables: boolean flag[2]; /*initially fales */ int turn; do { flag[i] = TRUE; while(flag[j]) { if(turn == j) { flag[i] = false; while(turn == j) ;//do nothing flag[i] = TRUE; } } // critical section turn = j; flag[i] = FALSE; // remainder section } while(TRUE); The structure of precess Pi (i == 0 or 1) ; The other process is Pj (j == 1 or 0) ; Prove that the algorithm satisfies all three requirements for the critical-section problem. 6-2. Explain why interrupts are not appropriate for implementing synchronization primitives in multiprocessor systems. 6-11. Show that, if the wait() and signal() semphore operations are not executed atomically, then mutual exclusion may be violated. 6-21. Explain why spinlocks are not appropriate for single-processor systems yet are often used in multiprocessor systems. 6-28. What is the meaning of the term busy waiting? What other kinds of waiting are there in an operating system? Can busy waiting be avoided altogether? Explain your answer. --

小當家根本就是毒梟,吃了他料理的人都會出現旗袍妹或是神龍的幻覺

被你一講這小當家團隊很像犯罪集團XXD

主謀小當家,執行雷恩,色誘要員嘟嘟,車手四郎,

保鑣解師父,顧問十全,政治公關及第,毒窟四川,

樓上兩位真是對仗工整 (y)
【你所不知道的小當家】 民明書坊 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 60.251.200.33

05/24 00:46, , 1F
頭推!
05/24 00:46, 1F
文章代碼(AID): #1By-xtHH (CHU_CS96b)