Lamport timestamps

Lamport timestamps

Leslie Lamport invented a simple mechanism by which the happened-before ordering can be captured numerically. A Lamport logical clock is a monotonically incrementing software counter.

It follows some simple rules:

# The counter is incremented before each event is issued at the process;
# When a process sends a message, it includes the counter value with the message;
# On receiving a message a process computes the counter as the maximum between their own value and the received value and then applies rule 1 before timestamping the event as received.

Considerations:For every two events "a" and "b" occurring in the same process, and being "C(x)" the timestamp for a certain event "x", it is necessary that "C(a)"!="C(b)" is always "true".

Therefore it is necessary that:

# The logical clock be set so that there is minimum of one clock "tick" (increment of the counter) between events "a" and "b";
# In a multiprocess or multithreaded environment, it might be necessary to attach the process ID (PID) or any other unique ID to the timestamp so that it is possible to differentiate between events "a" and "b" which may occur simultaneously in different processes.

Lamport's logical clock in distributed systems

* In a distributed system, it is not possible in practice to synchronize time across entities (typically thought of as processes) within the system; hence, the entities can use the concept of a logical clock based on the events through which they communicate.
* If two entities do not exchange any messages, then they probably do not need to share a common clock; events occurring on those entities are termed as concurrent events.
* Among the processes on the same local machine we can order the events based on the local clock of the system.
* When two entities communicate by message passing, then the send event is said to 'happen before' the receive event, and the logical order can be established among the events.
* A distributed system is said to have partial order if we can have a partial order relationship among the events in the system. If 'totality', i.e., causal relationship among all events in the system can be established, then the system is said to have total order.

ee also

*Vector clocks

References

*cite journal | author=Leslie Lamport | title=Time, clocks, and the ordering of events in a distributed system | journal=Communications of the ACM | year=1978 | volume=21 | issue=7 | pages=558–565 | doi=10.1145/359545.359563
url=http://research.microsoft.com/users/lamport/pubs/time-clocks.pdf


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать курсовую

Look at other dictionaries:

  • Vector clock — Vector Clocks is an algorithm for generating a partial ordering of events in a distributed system and detecting causality violations. Just as in Lamport timestamps, interprocess messages contain the state of the sending process s logical clock.… …   Wikipedia

  • Clock synchronization — is a problem from computer science and engineering which deals with the idea that internal clocks of several computers may differ. Even when initially set accurately, real clocks will differ after some amount of time due to clock drift, caused by …   Wikipedia

  • Logical clock — A logical clock is a mechanism for capturing chronological and causal relationships in a distributed system.Logical clock algorithms of note are: * Lamport timestamps, which are monotonically increasing software counters * Vector clocks, that… …   Wikipedia

  • Vektoruhr — Eine Vektoruhr ist eine Softwarekomponente (oder ein Protokoll) zum Zuweisen von eindeutigen Zeitstempeln an Nachrichten. Sie ist also eine logische Uhr, die es erlaubt, den Ereignissen in einem Verteilten System aufgrund eines Zeitstempels eine… …   Deutsch Wikipedia

  • Operational transformation — Operation Transformation redirects here. For the cross media event, see Operation Transformation (TV series). Operational transformation (OT) is a technology for supporting a range of collaboration functionalities in advanced groupware systems.… …   Wikipedia

  • Aggregate Level Simulation Protocol — The Aggregate Level Simulation Protocol (ALSP) is a protocol and supporting software that enables simulations to interoperate with one another. Replaced by the High Level Architecture (simulation) (HLA), it was used by the US military to link… …   Wikipedia

  • Horloge vectorielle — Article principal : horloge logique. Une horloge vectorielle est un dispositif logiciel introduit indépendamment en 1988 par Colin Fidge[1] et Friedemann Mattern[2] afin de donner à chaque processus d un système distribué asynchrone des… …   Wikipédia en Français

  • Public-key cryptography — In an asymmetric key encryption scheme, anyone can encrypt messages using the public key, but only the holder of the paired private key can decrypt. Security depends on the secrecy of that private key …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”