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

Discussion

A memory barrier is needed when

  • A.the order of two accesses matters to another agent
  • B.a variable is shared between two tasks of equal priority
  • C.a queue is used instead of shared memory
  • D.the compiler is invoked without optimisation

Answer: A

A processor or compiler may complete accesses out of program order, which matters when another core or a peripheral observes them. A barrier forbids the reordering across a chosen point, and it is quite separate from the mutual exclusion a lock provides.

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

Post your comment

Please log in or register to post a comment.