reshown by
411 views
0 votes
0 votes

hi,

C

an anyone answer this question? @arjun sir, 

 According to me there is no mutual exclusion and hence deadlock is not created. 

reshown by

1 Answer

1 votes
1 votes

Consider alternately executing the initial instructions of initializing i and j with TRUE and FALSE. You will find that i and j both can become TRUE. Hence, both will be trapped in the while() loop. So, deadlock is possible

Further, if we execute the instructions serially, i.e. first let Pi enter the CS and then Pj enter the CS, then mutually exclusion is violated

Related questions