Skip to content
AMS HW
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
red_envelope_algo.py
ubuntu01.out
ubuntu02.out
ubuntu03.out

README.md

Lamport Clocks

Python implementation of lamport clocks over 3 virtual machines.

The idea is abstracted through a game. The Chinese Red Envelope game. Here each VM sends random amount of money to the other machines. The VM that receives the message first should be able to access the money.

All the signals sent by nodes are logged
in the log files of each VM.

The messages are described below:

  1. "MON" : Money in the red envelope.
  2. "ACK" : Acknowledgement after the first message is received.
  3. "REQ" : Message to request claiming the resource from other nodes.
  4. "REL" : Message to release the resource.
  5. "WIN" : Message that the node has claimed the money in the envelope.
You can’t perform that action at this time.