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

Discussion

For a sensor whose most recent reading is the only one of interest, the right construct is

  • A.a long queue
  • B.a counting semaphore initialised to the reading
  • C.a recursive mutex protecting the reading
  • D.an overwriting mailbox

Answer: D

Correct answer: an overwriting mailbox

Where only the latest value matters, queueing older readings is worse than useless: it delays the current one behind stale data and can block the producer. An overwriting mailbox holds one item and replaces it, so the reader always gets the most recent reading and the writer never blocks.

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

Post your comment

Please log in or register to post a comment.