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

Discussion

Assertion: a queue is preferable to shared memory with a lock. Reason: the queue confines the shared state to the kernel, where it is already protected.

  • A.both the assertion and the reason are true and the reason explains the assertion
  • B.both the assertion and the reason are true but the reason does not explain the assertion
  • C.the assertion is true but the reason given for it is false
  • D.the assertion is false although the reason offered is a true statement in itself

Answer: A

Handing an item over and forgetting it removes every opportunity for a race, whereas shared memory leaves the discipline to every future maintainer. That confinement of the shared state is precisely why the queue is the safer structure.

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

Post your comment

Please log in or register to post a comment.