6.8 WMB - Write Memory Barrier

<< 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

6.8.1 Semantics

 

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.

 

6.8.2 Implementation

 

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;

 

6.8.3 Release Conditions

 

WMB is released when: all older store operations have completed and write buffers are empty. Loads may bypass WMB.

 

6.8.4 Typical Use

 

WMB is used for publishing data structures, releasing locks (store-release pattern), and preparing memory before device notification.

 

See Also: CBoxLib/CBoxBase.h (executeWMB).