C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
Problem on Counting SemaphoreThe questions are being asked on counting semaphore in GATE. Generally the questions are very simple that contains only subtraction and addition. Wait → Decre → Down → P Signal → Inc → Up → V The following type questions can be asked in GATE. A Counting Semaphore was initialized to 12. then 10P (wait) and 4V (Signal) operations were computed on this semaphore. What is the result?S = 12 (initial) 10 p (wait) : S = S -10 = 12 - 10 = 2 then 4 V : S = S + 4 =2 + 4 = 6 Hence, the final value of counting semaphore is 6.
Next TopicBinary Semaphore or Mutex
|