1 votes 1 votes closed with the note: I got the answer I was looking for Consider the methods used by processes P1 and P2 for accessing their critical sections whenever needed, as given below. The initial values of shared boolean variables S1 and S2 are randomly assigned. Method used by P1 Method used by P2 while (S1==S2); Critical Section S1=S2; while (S1!=S2); Critical Section S2 = not(S1) The above two processes are both deadlock free and starvation free . Is this statement right? Because both s1 and s2 are taking different sets of values to enter the critical section and hence no way they are getting blocked out all at once from their critical section.So no deadlock. Also its starvation free . Operating System operating-system process-synchronization + – chat28 asked Jan 15, 2016 closed Jan 15, 2016 by chat28 chat28 524 views comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 3 votes 3 votes Yes, This sequence of statements is both Deadlock free & Starvation free. Though as you can see, Progress is not guranteed. (If P1 does not want to enter critical section it can block P2 & so on !) Akash Kanase answered Jan 15, 2016 selected Jan 15, 2016 by chat28 Akash Kanase comment Share Follow See all 0 reply Please log in or register to add a comment.