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

Discussion

Two tasks communicate through a queue and never share memory. Locks between them are

  • A.unnecessary for that data, the queue providing the synchronisation
  • B.still necessary, a queue offering no mutual exclusion
  • C.necessary only if the queue holds pointers
  • D.necessary only if the tasks are of equal priority

Answer: A

The kernel protects the queue's own contents and the copy semantics mean neither task touches the other's storage, so there is nothing left to guard. Where a pointer is queued, ownership of the pointed-to buffer becomes a convention the two must observe, and that convention takes the place of the lock.

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

Post your comment

Please log in or register to post a comment.