[WEBINAR] Application Acceleration: Faster Performance for End Users

Peterson's Algorithm

Definition - What does Peterson's Algorithm mean?

Peterson's algorithm is a concurrent programming algorithm developed by Gary L. Peterson in a 1981 paper. It is known as a simple algorithm when compared to others. Peterson proved the algorithm using both the 2-process case and the N-process case.

Peterson's algorithm is used for mutual exclusion and allows two processes to share a single-use resource without conflict. It uses only shared memory for communication. Peterson's formula originally worked only with two processes, but has since been generalized for more than two.

Techopedia explains Peterson's Algorithm

Just as in Dekker's algorithm, turn variables (turn) and status flags (flag) are conditions or variables that are used in Peterson's algorithm. Because of these two conditions, and because of waiting for a turn only if other flags are set, the need to clear and reset flags is avoided. After a flag is set, the turn is immediately given away when using Peterson's algorithm.

Mutual exclusion, no progress and bounded waiting are three essential criteria used to solve the critical section problem when using the algorithm.

Techopedia Deals

Connect with us

Techopedia on Linkedin
Techopedia on Linkedin
"Techopedia" on Twitter

Sign up for Techopedia's Free Newsletter!

Email Newsletter

Join thousands of others with our weekly newsletter

Free Whitepaper: The Path to Hybrid Cloud
Free Whitepaper: The Path to Hybrid Cloud:
The Path to Hybrid Cloud: Intelligent Bursting To Amazon Web Services & Microsoft Azure
Free E-Book: Public Cloud Guide
Free E-Book: Public Cloud Guide:
This white paper is for leaders of Operations, Engineering, or Infrastructure teams who are creating or executing an IT roadmap.
Free Tool: Virtual Health Monitor
Free Tool: Virtual Health Monitor:
Virtual Health Monitor is a free virtualization monitoring and reporting tool for VMware, Hyper-V, RHEV, and XenServer environments.
Free 30 Day Trial – Turbonomic
Free 30 Day Trial – Turbonomic:
Turbonomic delivers an autonomic platform where virtual and cloud environments self-manage in real-time to assure application performance.