515 views
2 votes
2 votes
Say there is a Binary semaphore R, initialized to 0. Say process X and Y are working on R.

At T1 :- X has performed P(R); X gets blocked and gets added in Process Queue.

At T2 :-Y has performed V(R);

Will Process X get unblocked and removed from ready queue?

Which process will run after Y has performed V(R)? Process Y or Process X?

1 Answer

Best answer
2 votes
2 votes
Yes process X will get unblocked but there is no way to know either which process will continue on a processor.

This is one of the problem with semaphore
selected by

Related questions

1 votes
1 votes
1 answer
2
Rahul_Rathod_ asked Dec 12, 2018
1,570 views
a) s1-wait(p) , s2-wait(q) , s3-wait(q) , s4-wait(p)b) s1-wait(p) , s2-wait(q) , s3-wait(p) , s4-wait(q)c) s1-wait(q) , s2-wait(p) , s3-wait(p) , s4-wait(q)d) none of...
0 votes
0 votes
0 answers
3
balaganesh asked Sep 21, 2018
456 views
The number of binary semaphores required to implement readers-writers code in busy waiting mode is - answer given as 1.why 1 and why not 2?
2 votes
2 votes
1 answer
4