Please help me understand that, is there any schedule that P1 must access first R1 then R2 then R3 and at last R4 and same with P2, or the resources can be accessed in any order?
my understanding is that they can be accessed in any order.
Moreover, as per the solution does it mean that R1 of P2, R2 of P1, R3 of P2 and R4 of P1 does not have any restriction and can be accessed without checking any semaphore values?
If above two statements are true, then suppose currently P1 is executing R2, then P1 will execute V(Y) and Y becomes 1.
Now P2 can choose to execute R2 or R4. Lets say P2 chose R4 and executed it, but its not at all necessary that P1 has executed R4 yet, but it is a required condition. Then how does it work?
Please clarify my doubt and help me understand this problem.