Dekker’s Algorithm
Used to implement Semaphore. Not used in practice because it is slow.
This approach has the advantage of illustrating many of the common bugs encountered in developing concurrent programs.
A better algorithm is Peterson’s Algorithm.