首页 > 试题广场 >

The logical clock timestamp sc

[问答题]
The logical clock timestamp scheme presented in this chapter provides the following guarantee: If event A happens before event B,then the timestamp of A is less than the timestamp of B.Note,however,that one cannot order two events based only on their timestamps.The fact that an event C has a timestamp that is less than the timestampofevent D does not necessarily mean that event C happened before event D; C and D could be concurrent events in the system.Discuss ways in which the logical clock timestamp scheme could be extended to distinguish concurrent events from events that can be ordered by the happens-before relationship.
推荐

Vector clocks could be used to distinguish concurrent events from events ordered by the happens-before relationship.A vector clock works as follows.Each process maintains a vector timestamp that comprises of a vector of scalar timestamp,where each element reflects the number of events that have occurred in each of the other processes in the system.More formally,a process i  maintains a vector timestamp ti such that tji is equal to the number of events in process j that have occurred before the current event in process i.When a local event occurs in process i,tii is incremented by one to reflect that one more event has occurred in the process.In addition,any time a message is sent from a process to another process it communicates the timestamp vector of the source process to the destination process,which then updates its local timestamp vector to reflect the newly obtained information.More formally,when s sends a message to d, s communicates

ts along with the message and d updates td such that for all i≠d,tid= max(tis,tid).

发表于 2018-03-25 10:14:20 回复(0)