Giter Club home page Giter Club logo

nikita1212 / lamport-logical-clock-it-s-varification Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 1.0 8 KB

The Lamport Logical Clock problem Given a distributed system with N processes, each process goes through a finite number of events. The events could be internal or send or receive. We assume that broadcast is a send event with more than two receive events. In a correct execution of the (entire) distributed system: - each send event is followed by one or more receive events (no messages are lost) - a process has only one receive event associated with a send event executed at another process (there is no duplication of messages received) - there is no receive event without a send event that has happen at a different process earlier in the execution. We know that there is no global (shared) clock in a distributed system. Since a common physical clock is difficult to maintain and we are not interested in exact global real time but only in the ordering of these occurrences in time, we use the notion of logical clocks to have a partial order between events. As we learnt in the class, a logical clock C maps occurrences of events in a computation to partially ordered set such that π‘Žβ‰Ίπ‘ β‡’ 𝐢(π‘Ž) < 𝐢(𝑏). Two examples of logical clocks are Lamport’s logical clock and the vector clock. In class we discussed and gave examples of how to calculate the Lamport logical clock values for events. Each process encounters a number of events and each event will have a Lamport Logical Clock value, simply LC-value, associated with it. In the next paragraph we will describe how to calculate these values. After that we will discuss if,, given values, how to detect whether a process has a correct or incorrect execution. Both aspects are important for the two algorithms that you have to design and implement. Let P be some process in the N-node distributed network. We need to calculate the LC-value for all the events that P encounters. We will reword the definition of the Lamport logical clock to make it more recursive. Let a be some event encountered by P. 1. If a is the first event and is an internal or send event, then LC(a) = 1. 2. If a is the first event and is a receive event, then LC(a) = k + 1 where k is the LC-value of the send event corresponding to a (that has occurred at a process other than P). 3. If a is not the first event and is an internal or send event, then LC(a) = k + 1 where k is the LC-value of the event just before a at process P. 4. If a is not the first event and is a receive event, let b be the send event corresponding to a (that has occurred at a process other than P) and k be the clock value of the event just before a at process P. Then LC(a) = max{ k, LC(b) } + 1

License: Eclipse Public License 1.0

Java 100.00%

lamport-logical-clock-it-s-varification's People

Watchers

 avatar

Forkers

lakshaygupta21

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.