Assume turn =1 (initially).
1) P1 starts executing . Makes flag=True.
while(turn!=0) //Enter this Loop Bcoz Turn=1 actually.
2) P1 gets preempted here and P2 starts.Makes flag=True
while(turn!=1) //False bcoz turn=1 actually.Dont enter loop.
ENTER CRITICAL SECTION
Make flag = False.
3) Now P2 gets Preempted and P1 continue from where it left.
while flag==TRUE then keep moving in Loop . // but flag is False already.So dont enter it.
4) Now P1 gets Preempted and P2 starts again.Makes flag=True.
while(turn!=1) // turn is still Equal to 1 bcoz no one updated it to 0. So dont enter loop.
5) Now P2 gets Preempted and P1 continues from where it left.
turn = 0
So now WHILE loop breaks and P0 also enter CS.
So MUTUAL EXCLUSION itself is Not guaranteed if this order is followed.