05-04-2016, 11:51 AM
java code lamport s mutual exclusion algorithm
DAJ is an interactive, visual aid for studying distributed algorithms. Interactive, because you must explicitly specify every step of the interleaved execution sequence. Visual, because the state of the nodes is continuously displayed. Study aid, because they solve one of the most difficult problems encountered by students of these algorithms by automatically doing the necessary book-keeping. The program can create a log file of commands so that you can automatically replay scenarios until you understand them. Fourteen algorithms are current implemented, and you can implement other algorithms with only an elementary knowledge of Java. Visualizations are included for the virtual global structures contructed by some of the algorithms.
Lamport's bakery algorithm is a computer algorithm devised by computer scientist Leslie Lamport, which is intended to improve the safety in the usage of shared resources among multiple threads by means of mutual exclusion.
In computer science, it is common for multiple threads to simultaneously access the same resources. Data corruption can occur if two or more threads try to write into the same memory location, or if one thread reads a memory location before another has finished writing into it. Lamport's bakery algorithm is one of many mutual exclusion algorithms designed to prevent concurrent threads entering critical sections of code concurrently to eliminate the risk of data corruption.
Algorithms implemented
Byzantine generals algorithm for consensus (byzantine failures).
Byzantine generals algorithm for consensus (crash failures).
Byzantine generals algorithm for consensus by Berman and Garay (Algorithm 5.2 of Attiya and Welch).
EIGStop algorithm for consensus (Section 6.2.3 of Lynch).
Ricart-Agrawala algorithm for mutual exclusion.
Suzuki-Kasami algorithm for mutual exclusion.
Neilsen-Mizuno algorithm for mutual exclusion.
Lamport algorithm for mutual exclusion.
Maekawa algorithm for mutual exclusion.
Carvalho-Roucairol algorithm for mutual exclusion.
Dijkstra-Scholten algorithm for detecting termination.
Chandy-Lamport algorithm for global snapshots.
Huang algorithm for termination detection.
Mattern algorithm for termination detection.
DAJ is an interactive, visual aid for studying distributed algorithms. Interactive, because you must explicitly specify every step of the interleaved execution sequence. Visual, because the state of the nodes is continuously displayed. Study aid, because they solve one of the most difficult problems encountered by students of these algorithms by automatically doing the necessary book-keeping. The program can create a log file of commands so that you can automatically replay scenarios until you understand them. Fourteen algorithms are current implemented, and you can implement other algorithms with only an elementary knowledge of Java. Visualizations are included for the virtual global structures contructed by some of the algorithms.
Lamport's bakery algorithm is a computer algorithm devised by computer scientist Leslie Lamport, which is intended to improve the safety in the usage of shared resources among multiple threads by means of mutual exclusion.
In computer science, it is common for multiple threads to simultaneously access the same resources. Data corruption can occur if two or more threads try to write into the same memory location, or if one thread reads a memory location before another has finished writing into it. Lamport's bakery algorithm is one of many mutual exclusion algorithms designed to prevent concurrent threads entering critical sections of code concurrently to eliminate the risk of data corruption.
Algorithms implemented
Byzantine generals algorithm for consensus (byzantine failures).
Byzantine generals algorithm for consensus (crash failures).
Byzantine generals algorithm for consensus by Berman and Garay (Algorithm 5.2 of Attiya and Welch).
EIGStop algorithm for consensus (Section 6.2.3 of Lynch).
Ricart-Agrawala algorithm for mutual exclusion.
Suzuki-Kasami algorithm for mutual exclusion.
Neilsen-Mizuno algorithm for mutual exclusion.
Lamport algorithm for mutual exclusion.
Maekawa algorithm for mutual exclusion.
Carvalho-Roucairol algorithm for mutual exclusion.
Dijkstra-Scholten algorithm for detecting termination.
Chandy-Lamport algorithm for global snapshots.
Huang algorithm for termination detection.
Mattern algorithm for termination detection.