Multithreaded Granularity of Memory Access

The Alpha platform allows multithreaded access to shared data structures. Because of the potential for unintended writes to shared data structures, good programming practices make it essential that these structures be protected from writes with locks (for example, EnterCriticalSection, LeaveCriticalSection). This should be observed when both the alignment and size of the shared data match an atomic load/store unit of the underlying machine architecture, and even more critically, should especially be observed when the shared data size does not match a natural boundary or is smaller than 4 bytes.

For Alpha systems, granularity is 4 or 8 bytes. For x86 systems, it is 1, 2, or 4 bytes. For portability across these platforms, you should assume 4-byte granularity or protect multithreaded access to shared data with locks.