Time, Clocks, and the Ordering of Events in a Distributed System 論文閱讀筆記
之前看過一點分佈式算法:Distributed Computing —— Principles, Algorithms, and System 筆記,看這篇就比較輕鬆了。
happens-before relation: , event happens before event if
- 和 在同一進程,並且 sequences before
- 和 在不同進程,並且 synchronizes before ,即 是一個消息發送事件, 是一個消息接收事件
- 具有傳遞性
happens-before 是偏序關係(partial ordering),稱 與 是併發的,即 ,如果 並且 。
Logical Clock
logical clock 是每一個進程自己的遞增的 counter(遞增步幅不定),當一個事件發生時就產生一個 timestamp,。
如果 ,那麼
- 和 在同一進程,有
- 進程 的發送事件 和進程 的接受事件 ,有
於是有
反之不成立
Ordering the Events Totally
在進程間定義全序關係 ,可以任意指定
定義事件全序關係 ,事件 ,事件 ,如果
- 或者
於是有 推出
有句話他在 intro(Ref[1]) 中強調了:
The synchronization is specified in terms of a State Machine.
(在 FIFO 通信模型中)A process can execute a command timestamped when it has learned of all commands issued by all other processes with timestamps less than or equal to .
Physical Clocks
表示進程 在物理時刻 時的進程邏輯時鐘的值。
爲了保證:在物理時刻 從 發出的信息到達 的時鐘 一定比 大,我們需要找到一個 ,使得 ,其中 是比傳輸時間小的值。
粗略估計,當 時, 成立。(這保證了現實世界中的同步關係,即所有進程所組成的系統之外的 happens-before 關係)
最後給了個定理,沒看懂說的啥,以後看吧。
Reference
- Lamport introduction
- Lamport’s “Time, Clocks and the Ordering of events in a Distributed System.”
- Lamport timestamps - Wiki
- 論文筆記:Time, clocks, and the ordering of events in a distributed system
- Time and clocks and ordering of events in a distributed system
- 【每週論文】Time, Clocks, and Ordering of Events in a Distributed System
- time-clocks原版英文PPT
- Week 7: Time, Clocks, and Ordering of Events in a Distributed System