in Operating System
914 views
0 votes
0 votes

Original Question - https://gateoverflow.in/8405/gate2015-3-10

 

Answer is A) Yes, there's no ME (That's fine) 

Also there's no Deadlock, but for no deadlock, can we give reason as - 

 

There's no deadlock, because there's no circular wait as both processes X and Y are working on different sets of shared variables. 

X on varP and Y on VarQ. So, there's no dependency there. 

 

And hence No deadlock? Is this reasoning for deadlock valid?

in Operating System
by
914 views

4 Comments

in Process X, you used  the value of varQ and varP right?

But the VarQ is just used in while loop for condition checking, the operations of wait and signal are only on process X?

 

And yes, I totally agree with your answer about M.E and deadlock. Thankyou!

0
0

But the VarQ is just used in while loop for condition checking, the operations of wait and signal are only on process X?

here while loop acts as wait();

if you didn't get this, think that

depend upon varQ only Process X enters into CS, it uses varQ and varP.

1
1
Yes, makes sense, brother. Thank you! :)
0
0

1 Answer

1 vote
1 vote
ANSWER is B ,because when both the shared variables are True then the system will come in deadlock but it ensures  the mutual exclusion.

Related questions