Question discussion

A counting semaphore is initialised to 10. After 6 wait (P) operations and 4 signal (V) operations have completed, what is its value?

1765Medium DSSSB TGT Computer Science 0 replies 1 views
0

A counting semaphore is initialised to 10. After 6 wait (P) operations and 4 signal (V) operations have completed, what is its value?

  • A4
  • B10
  • C8
  • D12
Correct answer: C

Explanation

Each wait decrements and each signal increments the value, so the result is 10 − 6 + 4 = 8.

Discussion 0

Nobody has replied yet. Start the discussion!