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

Discussion

The limitation of a task notification compared with a semaphore is that it

  • A.cannot be used to signal an event at all
  • B.cannot carry a count of pending events
  • C.is lost if the receiver is not already waiting
  • D.must name the receiving task

Answer: D

Correct answer: must name the receiving task

A notification is sent directly to one task, so the sender must know which, and only one task can wait on it. A semaphore is an independent object that any task may signal and any may wait on, which suits a broadcast or an anonymous producer. The notification is faster and lighter for exactly the case it fits.

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

Post your comment

Please log in or register to post a comment.