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? Operating System + – Warlock lord 1.9k views answer comment Share Follow Print See all 6 Comments 6 6 Comments reply joshi_nitish commented Jan 7, 2018 i edited by joshi_nitish Jan 7, 2018 reply Follow flag the below pseudo-code of V(S) should be answer for your qsn, V(S) { if(wait queue is empty) { S=1; } else { select the process 'P' from wait queue and wake it; } } 2 2 replyShare Warlock lord commented Jan 7, 2018 reply Follow flag you mean V(S), right? 0 0 replyShare joshi_nitish commented Jan 7, 2018 reply Follow flag typo!! yes. 0 0 replyShare Warlock lord commented Jan 7, 2018 reply Follow flag thank you :) 1 1 replyShare Ekta07_GATE commented Mar 22, 2020 reply Follow flag Please provide book name, where pseudocode of binary semaphore present. Thankyou in advance. 0 0 replyShare Ekta07_GATE commented Mar 22, 2020 reply Follow flag From where you took this. Please clarify. @joshi_nitish Thankyou in advance. 0 0 replyShare Please log in or register to add a comment.
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. anjali007 answered May 8, 2018 anjali007 comment Share Follow See 1 comment 1 1 comment reply 2019_Aspirant commented Jan 9, 2019 reply Follow flag The comment says otherwise. 0 0 replyShare Please log in or register to add a comment.