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
while (S1 == S2);Critical Section S1 = S2;
Method used by P2while (S1 != S2);Critical SectionS2 = not(S1);
Which one of the following statements describes the properties achieved?
Mutual exclusion but not progress
Progress but not mutual exclusion
Neither mutual exclusion nor progress
Both mutual exclusion and progress
EDIT why in such codes we cannot preempt during executing while? is while an atomic expression here?