Logical clocks and logical time

13
1 | Internal use only Logical Time and Clocks Logical Time and Clocks

description

 

Transcript of Logical clocks and logical time

Page 1: Logical clocks and logical time

1 | Internal use only

Logical Time and ClocksLogical Time and Clocks

Page 2: Logical clocks and logical time

2 | Internal use only

The need for logical time

• Unlike conventional sequential programs. the computations performed

by distributed systems

– do not yield a linear sequence of eventsdo not yield a linear sequence of events

– system inherently define a partial orderingsystem inherently define a partial ordering

– genuinely concurrent events have no influence on one genuinely concurrent events have no influence on one

anotheranother.

Page 3: Logical clocks and logical time

3 | Internal use only

The relation “happened before,”

• Condition 1: 'Sequential behaviour'. If events ee and f f occur

in the same process instance pp, and ff occurs after ee,

– then e → f ( e happened before f )

• Condition 2: 'Process creation' . If event e and process

instance q occur in process instance p.

– event f occurs in q,

– and q begins after e,

– then e → f

Page 4: Logical clocks and logical time

4 | Internal use only

Happened before ...

• Condition 3: Process termination. If event e and process

instance q occur in process instance p.

– event f occurs in q.

– and e occurs after q terminates.

– then f → e

Page 5: Logical clocks and logical time

5 | Internal use only

Condition 4

• : Synchronous (un-buffered) message-passing.

– If event e is a synchronous input (output)

– and event f is the corresponding output (input),

– and there is an event g such that

• e → g,

• then f → g.

– If there is an event h such that h → e, then

• h → f

Page 6: Logical clocks and logical time

6 | Internal use only

Condition 5

• Asynchronous (buffered) message-passing.

– If event e is an asynchronous send and event f is the

corresponding receive,

• then e → f

Page 7: Logical clocks and logical time

7 | Internal use only

Condition 6

• Transitivity :

– e → f

– f → g

– Then e → g

Page 8: Logical clocks and logical time

8 | Internal use only

Concurrent Events

• a -/-> e , e -/-> a since they occur at different processes

• Such events are called concurrent

• Therefore a || e

Page 9: Logical clocks and logical time

9 | Internal use only

Page 10: Logical clocks and logical time

10 | Internal use only

Lamport Logical Clocks

Page 11: Logical clocks and logical time

11 | Internal use only

Vector time

Page 12: Logical clocks and logical time

12 | Internal use only

May be Continued ...

So any

Page 13: Logical clocks and logical time

13 | Internal use only

Thank You !!