Skip to content

Commit 51aabeb

Browse files
gibson042ljharb
authored andcommitted
Editorial: Make better use of the "Shared Data Block event" term (tc39#3396)
1 parent e6bc836 commit 51aabeb

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

spec.html

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51347,10 +51347,8 @@ <h1>Memory Model Fundamentals</h1>
5134751347
</table>
5134851348
</emu-table>
5134951349

51350-
<p>These events are introduced by abstract operations or by methods on the Atomics object.</p>
51351-
<p>Some operations may also introduce <dfn>Synchronize</dfn> events. A <dfn variants="Synchronize events">Synchronize event</dfn> has no fields, and exists purely to directly constrain the permitted orderings of other events.</p>
51352-
<p>In addition to Shared Data Block and Synchronize events, there are host-specific events.</p>
51353-
<p>Let the range of a ReadSharedMemory, WriteSharedMemory, or ReadModifyWriteSharedMemory event be the Set of contiguous integers from its [[ByteIndex]] to [[ByteIndex]] + [[ElementSize]] - 1. Two events' ranges are equal when the events have the same [[Block]], and the ranges are element-wise equal. Two events' ranges are overlapping when the events have the same [[Block]], the ranges are not equal and their intersection is non-empty. Two events' ranges are disjoint when the events do not have the same [[Block]] or their ranges are neither equal nor overlapping.</p>
51350+
<p>Shared Data Block events are introduced to candidate execution Agent Events Records by abstract operations or by methods on the Atomics object. Some operations also introduce <dfn variants="Synchronize,Synchronize event">Synchronize events</dfn>, which have no fields and exist purely to directly constrain the permitted orderings of other events. And finally, there are host-specific events.</p>
51351+
<p>Let the range of a Shared Data Block event be the Set of contiguous integers from its [[ByteIndex]] to [[ByteIndex]] + [[ElementSize]] - 1. Two events' ranges are equal when the events have the same [[Block]], [[ByteIndex]], and [[ElementSize]]. Two events' ranges are overlapping when the events have the same [[Block]], the ranges are not equal, and their intersection is non-empty. Two events' ranges are disjoint when the events do not have the same [[Block]] or their ranges are neither equal nor overlapping.</p>
5135451352
<emu-note>
5135551353
<p>Examples of host-specific synchronizing events that should be accounted for are: sending a SharedArrayBuffer from one agent to another (e.g., by `postMessage` in a browser), starting and stopping agents, and communicating within the agent cluster via channels other than shared memory. For a particular execution _execution_, those events are provided by the host via the host-synchronizes-with strict partial order. Additionally, hosts can add host-specific synchronizing events to _execution_.[[EventList]] so as to participate in the is-agent-order-before Relation.</p>
5135651354
</emu-note>
@@ -51466,14 +51464,14 @@ <h1>
5146651464
<h1>
5146751465
SharedDataBlockEventSet (
5146851466
_execution_: a candidate execution,
51469-
): a Set of events
51467+
): a Set of Shared Data Block events
5147051468
</h1>
5147151469
<dl class="header">
5147251470
</dl>
5147351471
<emu-alg>
5147451472
1. Let _events_ be an empty Set.
5147551473
1. For each event _E_ of EventSet(_execution_), do
51476-
1. If _E_ is a ReadSharedMemory, WriteSharedMemory, or ReadModifyWriteSharedMemory event, add _E_ to _events_.
51474+
1. If _E_ is a Shared Data Block event, add _E_ to _events_.
5147751475
1. Return _events_.
5147851476
</emu-alg>
5147951477
</emu-clause>
@@ -51709,7 +51707,7 @@ <h1>Tear Free Reads</h1>
5170951707
</emu-alg>
5171051708

5171151709
<emu-note>
51712-
<p>An event's [[NoTear]] field is *true* when that event was introduced via accessing an integer TypedArray, and *false* when introduced via accessing a floating point TypedArray or DataView.</p>
51710+
<p>A Shared Data Block event's [[NoTear]] field is *true* when that event was introduced via accessing an integer TypedArray, and *false* when introduced via accessing a floating point TypedArray or DataView.</p>
5171351711
<p>Intuitively, this requirement says when a memory range is accessed in an aligned fashion via an integer TypedArray, a single write event on that range must "win" when in a data race with other write events with equal ranges. More precisely, this requirement says an aligned read event cannot read a value composed of bytes from multiple, different write events all with equal ranges. It is possible, however, for an aligned read event to read from multiple write events with overlapping ranges.</p>
5171451712
</emu-note>
5171551713
</emu-clause>
@@ -51809,7 +51807,7 @@ <h1>Shared Memory Guidelines</h1>
5180951807
<p>Any transformation of an agent-order slice that is valid in the absence of shared memory is valid in the presence of shared memory, with the following exceptions.</p>
5181051808
<ul>
5181151809
<li>
51812-
<p><em>Atomics are carved in stone</em>: Program transformations must not cause the ~seq-cst~ events in an agent-order slice to be reordered with its ~unordered~ operations, nor its ~seq-cst~ operations to be reordered with each other, nor may a program transformation remove a ~seq-cst~ operation from the is-agent-order-before Relation.</p>
51810+
<p><em>Atomics are carved in stone</em>: Program transformations must not cause any Shared Data Block events having [[Order]] ~seq-cst~ to be removed from the is-agent-order-before Relation, nor to be reordered with respect to each other, nor to be reordered inside an agent-order slice with respect to events having [[Order]] ~unordered~.</p>
5181351811
<p>(In practice, the prohibition on reorderings forces a compiler to assume that every ~seq-cst~ operation is a synchronization and included in the final is-memory-order-before Relation, which it would usually have to assume anyway in the absence of inter-agent program analysis. It also forces the compiler to assume that every call where the callee's effects on the memory-order are unknown may contain ~seq-cst~ operations.)</p>
5181451812
</li>
5181551813
<li>

0 commit comments

Comments
 (0)