Consider two processes P1 and P2 accessing shared variable ‘x’ and ‘y’ protected by two binary semaphores Sx and Sy respectively both initialized to 1. ‘wait’ and ‘signal’ denote the usual semaphore operators, where wait decreaments the semaphore value, and signal increments the semaphore value.
S1: P = Wait (Sx), Q = Wait (Sy), R = Signal (Sx) and S = Signal (Sx) may lead to starvation.
S2: P = Wait (Sy ), Q = Wait (Sy), R = Signal (Sx) and S = Signal (Sx) may lead to race condition.
Which of the following is true?
How S1 lead to starvation? There is no While loop after performing the last signal operation, the process is not going to do these operations again. Also both these process executing two simple statement which will take constant time.