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

Discussion

Queuing a pointer rather than the data itself is done to

  • A.let two tasks send to the queue at the same time
  • B.remove the need for the queue to have a length
  • C.allow the receiver to block with a timeout
  • D.avoid copying a large payload

Answer: D

A four-byte pointer is copied where a kilobyte of data would be, which matters for an audio or network buffer. The cost is that ownership of the buffer must now be managed by convention, and getting that wrong gives a use-after-free.

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

Post your comment

Please log in or register to post a comment.