Operating Systems · Question 9 · Medium

Operating Systems question 9

A counting semaphore S is initialised to 8. Then 11 wait (P) operations and 5 signal (V) operations are performed on it. What is the final value of S?

  1. 2
  2. -3
  3. 13
  4. 0
Answer and explanation

Answer: A. 2

Explanation: Each wait decrements S by 1 and each signal increments it by 1, so the final value is 8 - 11 + 5 = 2.

Previous: A system has 3 page frames, all initially empty. For the page reference string… · Next: How many times is "Hi" printed when this C program runs? Assume every fork()…

Practise operating systems

Try a fresh set of operating systems questions with an explanation after every answer, free and without signing up: Operating Systems practice. Or sit a full placement mock test.

More operating systems questions

More technical & programming practice

Computer Networks · Software Engineering · Cloud & DevOps · GenAI Basics · Pseudo-code · C Programming · Java · Python

LogicWiz Exams home · All practice topics · Placement mock tests · Daily 10 challenge