1,938 views
2 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 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.
Position:
Show:

Related questions

2 2 votes
2 2 answers
151
151 views
GO Classes asked Jul 29
151 views
Two semaphores are initialized as:$S = 1$$T = 0$Two processes execute repeatedly:Process P$\texttt{wait(S);}$$\texttt{print("A");}$$\texttt{signal(T);}$Process Q$\texttt{...
2 2 votes
1 answers 1 answer
856
856 views
subhashchaganti asked Sep 21, 2022
856 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 in Process Queue.At...
1 1 vote
1 1 answer
1.3k
1.3k views
eyeamgj asked Sep 19, 2018
1,267 views
https://gateoverflow.in/37083/can-anyone-explain-the-below-question-in-a-detailed-wayanswer 0or 1??