Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Chandy–Lamport algorithm
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{one source |date=May 2024}} The '''Chandy–Lamport algorithm''' is a [[snapshot algorithm]] that is used in [[distributed systems]] for recording a consistent global state of an [[asynchronous communication|asynchronous]] system. It was developed by and named after [[Leslie Lamport]] and [[K. Mani Chandy]].<ref> Leslie Lamport, K. Mani Chandy: [https://research.microsoft.com/users/lamport/pubs/pubs.html#chandy ''Distributed Snapshots: Determining Global States of a Distributed System'']. In: ''ACM Transactions on Computer Systems 3''. Nr. 1, February 1985. ([http://lamport.azurewebsites.net/pubs/chandy.pdf PDF; 1 MB])</ref> ==History== According to [http://research.microsoft.com/users/lamport/pubs/pubs.html#chandy Leslie Lamport's website], the snapshot algorithm was described when he visited Chandy, who was at the [[University of Texas (Austin)]]. Chandy posed the problem over dinner, but they had had too much wine to think about it. The next morning, while Lamport was in the shower, he came up with the solution. When he arrived at Chandy's office, he was waiting for him with the same solution. Lamport considers the algorithm to be a straightforward application of the basic ideas in his article ''Time, Clocks and the Ordering of Events in a Distributed System''. <ref>{{Cite web |title=The Writings of Leslie Lamport |url=https://lamport.azurewebsites.net/pubs/pubs.html?from=https://research.microsoft.com/users/lamport/pubs/pubs.html&type=path#time-clocks |access-date=2024-08-24 |website=lamport.azurewebsites.net}}</ref> ==Definition== The assumptions of the algorithm are as follows: * There are no failures and all messages arrive intact and only once * The communication channels are unidirectional and [[FIFO (computing and electronics)|FIFO]] ordered * There is a communication path between any two processes in the system * Any process may initiate the snapshot algorithm * The snapshot algorithm does not interfere with the normal execution of the processes * Each process in the system records its local state and the state of its incoming channels The algorithm works using marker messages. Each process that wants to initiate a snapshot records its local state and sends a marker on each of its outgoing channels. All the other processes, upon receiving a marker, record their local state, the state of the channel from which the marker just came as empty, and send marker messages on all of their outgoing channels. If a process receives a marker after having recorded its local state, it records the state of the incoming channel from which the marker came as carrying all the messages received since it first recorded its local state. Some of the assumptions of the algorithm can be facilitated using a more reliable communication protocol such as [[Internet protocol suite|TCP/IP]]. The algorithm can be adapted so that there could be multiple snapshots occurring simultaneously. ==Algorithm== The Chandy–Lamport algorithm works like this: # The observer process (the process taking a snapshot): ## Saves its own local state ## Sends a snapshot request message bearing a snapshot token to all other processes # A process receiving the snapshot token ''for the first time'' on ''any'' message: ## Sends the observer process its own saved state ## Attaches the snapshot token to all subsequent messages (to help propagate the snapshot token) # When a process that has already received the snapshot token receives a message that does not bear the snapshot token, this process will forward that message to the observer process. This message was obviously sent before the snapshot “cut off” (as it does not bear a snapshot token and thus must have come from before the snapshot token was sent out) and needs to be included in the snapshot. From this, the observer builds up a complete snapshot: a saved state for each process and all messages “in the ether” are saved. ==References== {{Reflist}} {{DEFAULTSORT:Chandy-Lamport algorithm}} [[Category:Distributed algorithms]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Cite web
(
edit
)
Template:One source
(
edit
)
Template:Reflist
(
edit
)