29.1 Memory Model Fundamentals
Shared memory accesses (reads and writes) are divided into two groups, atomic accesses and data accesses, defined below. Atomic accesses are sequentially consistent, i.e., there is a strict total ordering of events agreed upon by all
No orderings weaker than sequentially consistent and stronger than unordered, such as release-acquire, are supported.
A Shared Data Block event is either a ReadSharedMemory, WriteSharedMemory, or ReadModifyWriteSharedMemory
Field Name | Value | Meaning |
---|---|---|
[[Order]] | The weakest ordering guaranteed by the |
|
[[NoTear]] | a Boolean | Whether this event is allowed to read from multiple write events with equal range as this event. |
[[Block]] | a |
The block the event operates on. |
[[ByteIndex]] | a non-negative |
The byte address of the read in [[Block]]. |
[[ElementSize]] | a non-negative |
The size of the read. |
Field Name | Value | Meaning |
---|---|---|
[[Order]] | The weakest ordering guaranteed by the |
|
[[NoTear]] | a Boolean | Whether this event is allowed to be read from multiple read events with equal range as this event. |
[[Block]] | a |
The block the event operates on. |
[[ByteIndex]] | a non-negative |
The byte address of the write in [[Block]]. |
[[ElementSize]] | a non-negative |
The size of the write. |
[[Payload]] | a |
The |
Field Name | Value | Meaning |
---|---|---|
[[Order]] | Read-modify-write events are always sequentially consistent. | |
[[NoTear]] | Read-modify-write events cannot tear. | |
[[Block]] | a |
The block the event operates on. |
[[ByteIndex]] | a non-negative |
The byte address of the read-modify-write in [[Block]]. |
[[ElementSize]] | a non-negative |
The size of the read-modify-write. |
[[Payload]] | a |
The |
[[ModifyOp]] | a |
An abstract closure that returns a modified |
These events are introduced by
Some operations may also introduce Synchronize events. A Synchronize event has no fields, and exists purely to directly constrain the permitted orderings of other events.
In addition to
Let the range of a ReadSharedMemory, WriteSharedMemory, or ReadModifyWriteSharedMemory event be the Set of contiguous
Examples of postMessage
in a browser), starting and stopping
Events are ordered within