Question: P i Consider the following code to solve the critical section problem involving two processes lo and P shared boolean flag[2] := {FALSE, FALSE); Code
Pi
Consider the following code to solve the critical section problem involving two processes lo and P shared boolean flag[2] := {FALSE, FALSE); Code for process P while (TRUE) do compute; lagli TRUE while (flag[1-1] = TRUE) do /do nothing endwhile critical section; flagli] : FALSE; endwhile; Answer the following questions: (a) Is it possible for both Po and Ps to be in their critical sections simultaneously? Explain your answer (b) Is it possible for l, and P to be involv(d in a deadlock? Explain your
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
