1,306 views
2 votes
2 votes
Say I have a Binary Semaphore S initialized to 1.

Consider V() as Signal and P() as Wait. If I now invoke V(S), will it wait for S to become 0? Or will it go on with further execution without making any changes to S?

1 Answer

0 votes
0 votes
When we perform any operation on a binary semaphore untill that operation is performed completely the process will wait untill a value is encountered on which the given semaphore operation can be performed . In the given question in the binary semaphore S untill it becomes 0 the signal operation can't be done and unless that statement is executed the control will not move on to the following statement.

Related questions

547
views
1 answers
2 votes
subhashchaganti asked Sep 21, 2022
547 views
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 ... queue?Which process will run after Y has performed V(R)? Process Y or Process X?
561
views
1 answers
1 votes
eyeamgj asked Sep 19, 2018
561 views
https://gateoverflow.in/37083/can-anyone-explain-the-below-question-in-a-detailed-wayanswer 0or 1??
1.0k
views
2 answers
1 votes
sumit chakraborty asked Nov 26, 2017
1,045 views
Given Processes P1: Wait(Sx); Wait(Sy); Do something;Signal(Sx); Signal(Sy); and Process P2: Wait(Sx); Wait(Sy); Do something;Signal(Sy); Signal(Sx); . Will it ever lead to starvation ?
563
views
1 answers
1 votes
sarannya asked Aug 6, 2017
563 views
In the standard code for UP operation,UP (S){ if(Waiting queue L is empty) S = 1; else ... a process can enter the critical section only after letting in, all the processes the got blocked before it?