- 论坛徽章:
- 0
|
这一个问题是关于Lamport Clocks的问题,我把Time-lines 的架构画出来了,可是题目的要求我不是很理解,希望学过的前辈可以指导一下,欢迎修改图片,谢谢
题目如下:
(a)
Consider three processes, P0,P1 and P2, executing on different machines.
Suppose that, in every real-time interval, Δt, P0’s clock is updated 4 time units, P1’s clock is updated 6 time units, and P2’s clock is updated 8 time units, due to clock skew. If the three processes send messages as shown in the following table, show how the local clocks(as seen by each process) are updated using Lamport’s clock algorithm, so that all process’s see the same total ordering of messages. HINT: Draw time-lines showing the local clock values every Δt real-time units for each process, over the interval in which messages are sent and received.
Message
| Sending Process
| Sending Time
| Receiving Process
| Message Latency
| M0
| P0
| 4
| P1
| 2Δt
| M1
| P1
| 24
| P2
| 3Δt
| M2
| P2
| 56
| P1
| 2Δt
| M3
| P1
| 60
| P0
| Δt
|
NOTE: In the table, the “Sending Time” is the time seen by the sending process before Lamport’s clock algorithm has updated any local clocks,
while “Message Latency” is the real-time delay to send a message. State any assumptions you make when applying the “happens before” relationship.
![]()
[ 本帖最后由 ckjboy2003 于 2009-1-21 23:59 编辑 ] |
|