Peterson's Algorithm
A much simpler solution
Hardware Primitives
The Test_and_Set primitive
An algorithm based on the Test_and_Set primitive