2
$\begingroup$

By using Lamport timestamps, we can determine the causality of messages. It is however unclear to me how one would deduce this simply from the lamport timestamp of the message.

Take the following model situation: there is a casuality break when it comes to process 2:

Example

Now, we add Lamport clocks (hopefully I have done that correctly)

Example with timestamps

I'm at loss when it comes to understanding how I can read out the correct casuality of received messages by process 2 from just the timestamps. Unless I haven't determined the timestamps properly.

It looks like there's some additional information needed to do that. Maybe to save the timestamp of the message itself, and the id of the sending process?

$\endgroup$

1 Answer 1

1
$\begingroup$

Lamport clocks are not designed to allow you to infer all causality. No one ever claimed that knowing the Lamport timestamp is enough to read out the causality of all messages.

Rather, Lamport clocks provide a partial ordering that is consistent with causality: if event $a$ happens before event $b$ (causally), then $a$'s timestamp will be smaller than event $b$. The converse does not necessarily hold.

See https://en.wikipedia.org/wiki/Lamport_timestamps and https://en.wikipedia.org/wiki/Lamport_timestamps#Implications.

If you want to read out the full causality, use vector clocks or other methods that are designed for that.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.