1.

At a particular time of computation the value of a counting semaphore is 7.Then 20 P operations and 15 V operations were completed on this semaphore. The resulting value of the semaphore is? (GATE 1987)(a) 42(b) 2(c) 7(d) 12The question was posed to me at a job interview.The above asked question is from Semaphores topic in division Process Synchronization of Operating System

Answer» RIGHT option is (b) 2

To explain: P represents Wait and V represents Signal. P operation will decrease the VALUE by 1 every TIME and V operation will increase the value by 1 every time.


Discussion

No Comment Found

Related InterviewSolutions