Question 74
Explanation
A counting semaphore is initialized to 8. 3 wait() operations and 4 signal() operations are applied. Find the current value of semaphore variable.
Answer : 1. 9 Explanation
Previous | Next |
UGC NET CS December 2019 - Question 73 | UGC NET CS December 2019 - Question 75 |
Initially counting semaphore value is 8.
3 Wait operations= - 3
4 Signal operation= + 4
= 8 - 3 + 4
= 5 + 4
= 9
So, option 1 is correct answer
Counting semaphore can take non-negative integer values.
Two standard operations, wait and signal are defined on the semaphore. Entry to the critical section is controlled by the wait operation and exit from a critical region is taken care by signal operation. The wait, signal operations are also called P and V operations. The manipulation of semaphore (S) takes place as following:
Reference : OS Semaphores