The Gateway to Computer Science Excellence
+1 vote
245 views

in Operating System by Active (2.5k points)
edited by | 245 views
0
option C. We can get deadlock
0
how??
0
is not it peterson's solution??which is Mutual exclusive ..so C
0
Both process arrive at the while loop at the same time
0
If both process arrive at while loop simultaneously then one while loop will definitely be false because turn value will be either i or j

isnt it???
0
process I()

{

   while(turn == j    &&  flag[j] ==true)

}

 

process J()

{

   while(turn == i    &&  flag[i] ==true)

}
0

@Sushant Gokhale 

is it Peterson solution ?

1 Answer

0 votes

Option (b) 

The process that executes statement-2 last will always be the first one to enter the CS.

 

by (207 points)

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,737 questions
57,321 answers
198,387 comments
105,140 users