1. 根據第六章Synchronization內容作答
(a) 說明為何在multiprocessor系統中,不適合用interrupts實現synchronization primitives
可能會有多個程序使用同個資源造成衝突
(b) 說明race condition 發生的原因
cc08310112tw 發表在 痞客邦 留言(0) 人氣(2,127)
software-based
two process (load, store)
不能被interrupted
share two variables
cc08310112tw 發表在 痞客邦 留言(6) 人氣(5,875)

(當一個system有很多process)
每個process都有critical section (關鍵區,臨界區) segment of code
修改 common variables, 更新表格, writing file
cc08310112tw 發表在 痞客邦 留言(0) 人氣(4,729)
Process 可以同步執行 可能會隨時interrupt
concurrent Acess share data 可能會產生矛盾
(counter++)
cc08310112tw 發表在 痞客邦 留言(0) 人氣(264)

load sharing
homogeneous Multiprocessor system (系統在同個處理器)
Asymmetric multiprocessing : 一個主要處理器,其他附屬
cc08310112tw 發表在 痞客邦 留言(0) 人氣(2,563)
Contention Scope
區分 user-level and kernel-level threads
LMP裡
PCS = process-contention scope (set by program priority)
cc08310112tw 發表在 痞客邦 留言(0) 人氣(1,319)

First-come First-served
缺點:將較長的置前,會浪費時間
convoy effect : 等待一個特別大的process
cc08310112tw 發表在 痞客邦 留言(0) 人氣(1,977)

CPU utilization : 使CPU忙碌
Throughput (產量) : 每單位時間所完成產量
Turnaround time (往返時間) : 工作提出~完成
waiting time : 在ready queque 等待的時間
cc08310112tw 發表在 痞客邦 留言(0) 人氣(606)
有以下狀況必須做排程
1. running state ~waiting state (Ex: I/O request)
2. running state ~ready state (interrupt)
cc08310112tw 發表在 痞客邦 留言(0) 人氣(5,281)
exec()可重新載入可執行檔
把可執行檔的machine code 搬進 process 的 memory
然後呼叫可執行檔之中的main 函式
(如果被執行就像失憶一樣,但PID不會變)
cc08310112tw 發表在 痞客邦 留言(6) 人氣(3,347)