• edited by
4,550 views

2 Answers

4 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 1 vote
Primary purpose is To provide Mutual Exclusion and it also prevents deadlock.
Position:
Show:

Related questions

2 2 votes
3 3 answers
2.8k
2.8k views
Sambhrant Maurya asked Jan 3, 2019
2,818 views
P1 terminates but P2 does notP2 terminates but P1 does notBoth P1 and P2 terminateNeither P1 nor P2 terminate
1 1 vote
0 0 answers
1.4k
1.4k views
MiNiPanda asked Jan 1, 2019
1,448 views
Consider the following 2 functions P and Q which share 2 common variables A and B:P() Q() { { A=A+5; A=B+6; B=A-3; B=A-2; } }If P and Q execute concurrently, the initial ...
0 0 votes
1 1 answer
934
934 views
Gokulnath asked Dec 21, 2018
934 views
The definition of progress is: “When no process is in the critical section and another process wants to enter the critical section, then it should be allowed without any ...
0 0 votes
0 0 answers
828
828 views
Hopealways asked Dec 1, 2018
828 views
In these type of questions “Will we NOT consider CONTEXT SWITCHING unless mentioned???”If context switching is ALLOWED, minimum value will be 8...Correct me if I’m wrong.