edited by
3,098 views

2 Answers

4 votes
4 votes

Petersons Algorithm is a Programming Algo that allows two process to share a single -use resource without conflict,using only shared memory for communication..

There has been many Algorithms before Petersons Like...

Lock Variable (No Mutual Exclusion)
TSL (Mutual Exclusion,Progress but not Bounded waiting)
Strict Alternation or Turn Variable (Mutual Exclusion but not Progress)
Using Interested Array (
Mutual Exclusion,Progress but not Bounded waiting)

Peterson Algo Combines Turn Variable and Interested Array Concepts
and Provides All Four : Mutual Exclusion  
                                     Progress    
                                     Bounded Waiting
                                     Architecture Neutrality

I would Go with Option 2 :)

 

edited by
1 votes
1 votes
Primary purpose is To provide Mutual Exclusion and it also prevents deadlock.

Related questions

2 votes
2 votes
3 answers
1