answersLogoWhite

0

Lamport's logical clock

Updated: 11/10/2022
User Avatar

Wiki User

14y ago

Best Answer

Leslie Lamport proposed this scheme to provide ordering of events in a distributed environment using logical clocks. Because it is impossible to have perfectly synchronized clocks and global time in a distributed system, it is often necessary to use logical clocks instead. Definitions:

Happened Before Relation (->). This relation captures causal dependencies between events, that is, whether or not events have a cause and effect relation. This relation (->) is defined as follows: * a -> b, if a and b are in the same process and a occurred before b. * a -> b, if a is the event of sending a message and b is the receipt of that message by another process. * If a -> b and b -> c, then a -> c - that is, the relation has the property of transitivity. Causally Related Events: If event a -> event b, then a causally affects b. Concurrent Events: Two distinct events a and b are concurrent (a b) if (not) a -> b and (not) b -> a. That is, the events have no causal relationship. This is equivalent to b a. For any two events a and b in a system, only one of the following is true: a -> b, b -> a, or a b. Lamport introduced a system of logical clocks in order to make the -> relation possible. It works like this: Each process Pi in the system has its own clock Ci. Ci can be looked at as a function that assigns a number, Ci(a) to an event a. This is the timestamp of the event a in process Pi. These numbers are not in any way related to physical time -- that is why they are called logical clocks. These are generally implemented using counters, which increase each time an event occurs. Generally, an event's timestamp is the value of the clock at that time it occurs. Conditions Satisfied by the Logical Clock system:

For any events a and b, if a -> b, then C(a) < C(b). This is true if two conditions are met: * If a occurs before b, then Ci(a) < Ci(b). * If a is a message sent from Pi and b is the recept of that same message in Pj, then Ci(a) < Cj(b). Implementation Rules Required

* Clock Ci is incremented for each event: Ci := Ci + d (d > 0) * if a is the event of sending a message from one process to another, then the receiver sets its clock to the max of its current clock and the sender's clock - that is, Cj := max(Cj, tm + d) (d > 0) .

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Lamport's logical clock
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Conditions to be satisfied by lamports logic clock?

Conditions satisfied by the logical clocks&Acirc;&middot; Clock condition: if a&Atilde;&nbsp;b,&Acirc;&middot; then C(a) < C(b)o If event a happens before event b, then the clock value (timestamp) of a should be less than the clock value of bo Note that we can not say: if C(a)


Drawbacks of Lamport logical clock?

Lamport's clock does'nt ensure that if L(e1)&lt;L(e2) e1-&gt;e2


What is positive and negative trigger SR flip flop with clock input?

WHY not what positive triggering means as a signal rises from a negative potential and vice verse. R means reset whereby a state is mandated by that signal. Set is the means TO SET A FLIP FLOP to a certain condition. When S = logical '1' value, and the clock input toggles, the output (normally labelled 'Q') will be a logical '1'. when R = logical '1' and the clock input toggles, the output will become a logical '0'.


What is clock speed?

Here is a short explanation. Clock rate or clock speed is the speed at which a microprocessor (CPU) executes instructions. Clock speeds are typically expressed in megahertz (MHz) or gigahertz ((GHz). A single clock cycle (usually shorter than a nanosecond in modern non-embedded microprocessors) toggles between a logical zero and a logical one state. Sources: http://www.webopedia.com/TERM/C/clock_speed.html http://en.wikipedia.org/wiki/Clock_rate


What ticks but never tocks but can tock but never tick?

This is a really interesting scenario. However, the answer is a clock. It is only logical because it ticks and tocks, but not at the same time.


What is a processor clock speed?

Here is a short explanation. Clock rate or clock speed is the speed at which a microprocessor (CPU) executes instructions. Clock speeds are typically expressed in megahertz (MHz) or gigahertz ((GHz). A single clock cycle (usually shorter than a nanosecond in modern non-embedded microprocessors) toggles between a logical zero and a logical one state. Sources: http://www.webopedia.com/TERM/C/clock_speed.html http://en.wikipedia.org/wiki/Clock_rate


What is the difference between vector clock and lamport's logical clock?

Reading Vector Clock TimestampsCausally OR Concurrent:Events a and b are either causally related or they are concurrent. Definition: "event a" causes "event b" if and only if ta < tbwhere: ta < tb If and only if they meet two conditions:they are not equal timestamps ( there exists i, ta[i] != tb[i]) andeach ta[i] is less than or equal to tb[i] (for all i, ta[i]


What has hands but cannot clap?

A clock has hands but cannot clap.


Difference between Bus Clock and System Clock in Microcontrollers?

Bus Clock is based on the System Clock. In other terms Bus Clock is derived from system Clock. Bus Clock is usually half System Clock. (Busy Clock = System Clock / 2)


How is a computer's clock different from real clock?

A computers clock is a real clock


What happened to the hen that ate a clock?

It went, "Clock, Clock!" Get it? Clock instead of Cluck?


What is another term for Longcase clock?

There are many synonyms to the term, longcase clock. A longcase clock is also called a grandfather clock, floor clock, and tall-case clock. Many people know this type of clock as a grandfather clock.