edited by
850 views
3 votes
3 votes

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?

edited by

1 Answer

0 votes
0 votes
S1 looks correct...bounded waiting may not be satisfied in a solution with semaphore but since we have progress so it's true

but S2 is false

Related questions

2 votes
2 votes
1 answer
1
1 votes
1 votes
0 answers
3
snaily16 asked Jan 12, 2019
497 views
Fails to Guarantee mutual exclusion Guarantee mutual exclusion and prevents deadlockFails to prevent deadlockFails to guarantee mutual exclusion and fails to prevent dead...
2 votes
2 votes
3 answers
4