Multicore & Synchronization
Which statement is correct about weak memory consistency models such as those of Arm and RISC-V (RVWMO)?
- AThey allow many reorderings of accesses to different addresses, and programs insert barriers where order is needed
- BThey allow no reordering, so barrier instructions do not exist
- CThey do not even guarantee ordering of accesses to the same address
Show answer and explanation
Answer: A. They allow many reorderings of accesses to different addresses, and programs insert barriers where order is needed
Weak models let hardware reorder fairly freely reads and writes to different addresses that have no dependence. This simplifies circuits and helps performance and power efficiency, but when passing data to other cores, order must be stated explicitly with fence instructions or with loads and stores carrying acquire or release semantics. In high-level languages, using atomic variables makes the compiler emit the right instructions.
- A. Correct. Hardware gains freedom, and ordering is requested explicitly.
- B. RISC-V has the fence instruction.
- C. Ordering to the same address is maintained by coherence.