1 / 13

Lecture 1: Logical and Physical Time with some Applications

Lecture 1: Logical and Physical Time with some Applications. Anish Arora CSE 6333 Notes include material from Dr. Jeff Brumfield. Required Reading. Time, Clocks, and the Ordering of Events in a Distributed System by Leslie Lamport

martinmark
Download Presentation

Lecture 1: Logical and Physical Time with some Applications

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture 1:Logical and Physical Timewith some Applications Anish Arora CSE 6333 Notes include material from Dr. Jeff Brumfield

  2. Required Reading • Time, Clocks, and the Ordering of Events in a Distributed System • by Leslie Lamport • research.microsoft.com/users/lamport/pubs/time-clocks.pdf • Chapter 5 in Paul Sivilotti's book

  3. Why Time Is Important • Scheduling of Requests • Time-dependent policies such as FCFS • Prearranged Synchronization • Set of processes perform action at give time • Each process has time slice for activity • One process begins at time another finishes • Multi-version Objects • Latest timestamp implies newest version • Interpretation of Data • Data that is a function of time (e.g., seismic data) • Timestamping Events

  4. Motivation Observer A: “star 1 exploded before star 2” Observer B: “star 2 exploded before star 1” Can the observers determine the truth? What if the speed of light is not constant?

  5. Ordering Events What do we mean when we say that: event A happened before event B? • Answer: A happened at an earlier time than B • Problem: This definition requires clocks. Clocks aren't perfectly accurate and don't keep precise physical time Can we define the notion of “happened before” without using clocks?

  6. The “Happened Before” Relation • Event A happened before event B if • 1) A and B are events in the same process and A came before B • 2) A is the sending of a message by one process and B is the receipt of that message by another process • 3) A happened before C, and C happened before B • This definition assumes that a process is a set of events with an a priori total ordering • If event A happened before event B then it is possible for event A to causally affect event B

  7. Concurrent Events • Events A and B are concurrent if • 1) A did not happen before B, and • 2) B did not happen before A • If two events are concurrent, then neither can causally affect the other • Note that concurrency is not transitive. If A and B are concurrent and B and C are concurrent, it does not necessarily follow that A and C are concurrent

  8. Space-Time Diagrams

  9. Logical Clocks • A clock is a way of assigning a number to an event, where the number is thought of as the time at which the event occurred • Assume each process has a clock that assigns a number to any event in that process. A clock could simply be a counter • A system of clocks is said to be correct if it satisfies the following condition: • For any two events A and B, if A happened before B then the time of event A is less than the time of event B

  10. Implementing Logical Clocks • Each process maintains its own logical clock, which assigns times to events in that process • Each process increments its logical clock between successive events • Each message contains a timestamp whose value is the time at which the message was sent • Upon receiving a message, a process sets its clock greater than or equal to its present value and greater than the timestamp

  11. Logical Clocks

  12. Ordering Events Totally • A system of logical clocks can be used to totally order the set of all system events: • Order the events by the times at which they occur • Break ties using any total ordering of the processes (e.g., unique process numbers) • The total ordering depends on the system of clocks and the tie breaking scheme. It is not unique

  13. Anomalous Behavior B's message may be given an earlier timestamp than A's, even though A and B both know that A's message was sent first

More Related