Question
Why is a memory barrier used in concurrent code?
Select an option. Your answer will be checked instantly.
Correct Answer: B. To enforce ordering and visibility of memory operations across processors
Explanation:
Modern processors and compilers may reorder memory operations unless constrained.
A memory barrier ensures required reads and writes become visible in the intended order.
Leave a Reply