Szymański's algorithm
Szymański's Mutual Exclusion Algorithm is a mutual exclusion algorithm devised by computer scientist Dr. Bolesław Szymański, which has many favorable properties including linear wait, and which extension solved the open problem posted by Leslie Lamport whether there is an algorithm with a constant number of communication bits per process that satisfies every reasonable fairness and failure-tolerance requirement that Lamport conceived of (Lamport's solution used n factorial communication variables vs. Szymański's 5). Source: e01 Encyclopedia. Licence: CC BY-SA 4.0.
Szymański's Mutual Exclusion Algorithm is a mutual exclusion algorithm devised by computer scientist Dr. Bolesław Szymański, which has many favorable properties including linear wait, and which extension solved the open problem posted by Leslie Lamport whether there is an algorithm with a constant number of communication bits per process that satisfies every reasonable fairness and failure-tolerance requirement that Lamport conceived of (Lamport's solution used n factorial communication variables vs. Szymański's 5). Entry protocol flag[self] ← 1 # Standing outside waiting room await(all flag[1..N] ∈ {0, 1, 2}) # Wait for open door flag[self] ← 3 # Standing in doorway if any flag[1..N] = 1: # Another process is waiting to enter flag[self] ← 2 # Waiting for other processes to enter await(any flag[1..N] = 4) # Wait for a process to enter and close the door flag[self] ← 4 # The door is closed await(all flag[1..self-1] ∈ {0, 1}) # Wait for everyone of lower ID to finish exit protocol Critical section ... Exit protocol await(all flag[self+1..N] ∈ {0, 1, 4}) # Ensure everyone in the waiting room has # realized that the door is supposed to be closed flag[self] ← 0 # Leave. Reopen door if nobody is still in the waiting room Note that the order of the "all" and "any" tests must be uniform. Despite the intuitive explanation, the algorithm was not easy to prove correct, however due to its favorable properties a proof of correctness was desirable and multiple proofs have been presented.
Cite this
"Szymański's algorithm". 1780625060. e01 Encyclopedia. CC BY-SA 4.0. https://en.wikipedia.org/w/index.php?oldid=1357867717 JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy