in Operating System edited by
3,111 views
2 votes
2 votes
Description of Peterson's Algorithm & also for which problem it is used to solve

(1) deadlock

(2) mutual exclusion

(3) Thrashing

(4) Paging.
in Operating System edited by
3.1k 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

4 Comments

peterson algorithm doesnt maintain Mutual exclusiion which mean one of the condition for preventing deadlock is satisfied . so it should be deadlock !
0
0
Peterson algorithm ensures mutual exclusion rt?
0
0
Sorry yes it does . i was actually talking about LOCK variable .
1
1
1 vote
1 vote
Primary purpose is To provide Mutual Exclusion and it also prevents deadlock.

4 Comments

yes it could be.but The way ques s asked makes me think that he s taking all 4 options as problems. No mutual exclusion is a problem coz it ll lead to Race condition.
0
0
No, you should clear this thing- it can cause you many marks in various topics. Mutual exclusion is not a problem- it is something desirable. Race condition is a problem. We should always answer as per the questions- not as per what we studied. Those who haven't studied much can sometimes do well in GATE because they will be answering as per question.
0
0
correct, race cond. is not mentioned directly so we will go for deadlock.yes sometimes we can overthink about a question and mark wrong answer.

thanks :)
1
1

Related questions