Machine-translated by Google. Questions are authored in English.
Top

Discussion

A task signals a binary semaphore three times before any task waits on it. The waiting task will return

  • A.once, two of the three signals having been lost
  • B.three times, each signal having been remembered
  • C.never, the semaphore having overflowed
  • D.twice, the first signal having been discarded

Answer: A

Correct answer: once, two of the three signals having been lost

A binary semaphore holds a single bit, so signalling it when it is already signalled changes nothing. Two of the three events are lost. A counting semaphore would have recorded all three, which is exactly the case counting semaphores exist for.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.