|
<< Click to Display Table of Contents >> Navigation: ASA-EMulatR Reference Guide > Introduction > Architecture Overview > Chapter 6 - Serialization and Stall Model > 6.8 WMB - Write Memory Barrier |
WMB enforces ordering of stores only. It guarantees that all prior stores are globally visible and write buffers are drained. It does not order loads — loads may bypass WMB freely.
CBox::executeWMB() is lighter than MB — it drains the local write buffer only, with no global coordination. After draining, it sets slot.serialized = true to mark the barrier as complete.
// CBox::executeWMB()
drainWriteBuffers(&slot); // Local drain only, no global coordination
slot.serialized = true;
WMB is released when: all older store operations have completed and write buffers are empty. Loads may bypass WMB.
WMB is used for publishing data structures, releasing locks (store-release pattern), and preparing memory before device notification.
See Also: CBoxLib/CBoxBase.h (executeWMB).