Skip to content

Commit

Permalink
Take n, back to transitive closure
Browse files Browse the repository at this point in the history
  • Loading branch information
domenic committed Apr 21, 2017
1 parent 5c907d8 commit 3ef7992
Showing 1 changed file with 44 additions and 18 deletions.
62 changes: 44 additions & 18 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -88546,30 +88546,56 @@ import "https://example.com/foo/../module2.js";</pre>
</dd>
</dl>

<p>For convenience in what follows, for all <span data-x="agent">agents</span> that are not <span
data-x="similar-origin window agent">similar-origin window agents</span>, we define <dfn
data-x="concept-agent-global">the agent's global object</dfn> to be the <span
data-x="concept-realm-global">global object</span> of the single <span data-x="JavaScript
realm">realm</span> in the agent's set of realms.</p>

<p>To determine the manifestation of JavaScript's <span>agent cluster</span> concept in user
agents, we define which <span data-x="agent">agents</span> <dfn>can share memory with</dfn>
another. Then all the <span data-x="agent">agents</span> that can <span>can share memory
with</span> each other form an <span>agent cluster</span>.</p>
agents, we define which <span data-x="agent">agents</span> <dfn>can directly share memory
with</dfn> another:</p>

<p class="note">The <span>can share memory with</span> relation is symmetric.</p>
<dl class="switch">
<dt><span>Similar-origin window agent</span></dt>
<dd><p>Any <span>dedicated worker agent</span> whose <span data-x="concept-agent-global">global
object</span>'s <span>owner set</span> contains a <code>Document</code> object whose <span
data-x="concept-relevant-realm">relevant Realm</span> belongs to <var>agent</var>.</p></dd>

<p>A <span>similar-origin window agent</span>, <span>dedicated worker agent</span>, <span>shared
worker agent</span>, or <span>service worker agent</span>, <var>agent</var>, <span>can share
memory with</span> any <span>dedicated worker agent</span> whose single <span data-x="JavaScript
realm">realm</span>'s <span data-x="concept-realm-global">global object</span>'s <span>owner
set</span> contains an item whose <span data-x="concept-relevant-realm">relevant Realm</span>
belongs to <var>agent</var>.</p>
<dt><span>Dedicated worker agent</span></dt>
<dd>
<p>Any <span>agent</span> with a <span data-x="JavaScript realm">realm</span> that is the <span
data-x="concept-relevant-realm">relevant Realm</span> of an item in <var>agent</var>'s
<span data-x="concept-agent-global">global object</span>'s <span>owner set</span>.</p>

<p class="note">We use item above as an <span>owner set</span> can contain <code>Document</code>
objects.</p>
<p class="note">Recall that the <span>owner set</span> can contain both <code>Document</code>
and <code>WorkerGlobalScope</code> objects.</p>
</dd>

<dt><span>Worklet agent</span></dt>
<dd><p class="&#x0058;&#x0058;&#x0058;">Currently worklets have no clearly defined owner, see: <a
href="https://github.com/w3c/css-houdini-drafts/issues/224">w3c/css-houdini-drafts issue
#224</a>.</p></dd>

<dt><span>Shared worker agent</span></dt>
<dt><span>Service worker agent</span></dt>
<dd><p>Any <span>dedicated worker agent</span> whose <span data-x="concept-agent-global">global
object</span> is in <var>agent</var>'s <span data-x="concept-agent-global">global object</span>'s
<span>worker set</span>.</p></dd>
</dl>

<p>In addition, any <span>agent</span> <span>can directly share memory with</span> itself.</p>

<p class="&#x0058;&#x0058;&#x0058;">A <span>worklet agent</span> &hellip; currently worklets have
no clearly defined owner, see: <a
href="https://github.com/w3c/css-houdini-drafts/issues/224">w3c/css-houdini-drafts issue
#224</a>.</p>
<p>Given the above definition, <span>can directly share memory with</span> is a reflexive and
symmetric binary relation over the set of all <span data-x="agent">agents</span>. We then define
the <dfn>can share memory with</dfn> binary relation as the transitive closure of <span>can
directly share memory with</span>. Thus, <span>can share memory with</span> is an equivalence
relation: it is reflexive, symmetric, and transitive. We finally define the <span data-x="agent
cluster">agent clusters</span> to be the equivalence classes of <span>can share memory
with</span>.</p>

<p>The <span>agent cluster</span> concept is crucial for defining the JavaScript memory model, and
in particular among which <span data-x="agent">agents</span> the backing data of
<p class="note">The <span>agent cluster</span> concept is crucial for defining the JavaScript
memory model, and in particular among which <span data-x="agent">agents</span> the backing data of
<code>SharedArrayBuffer</code> objects can be shared.</p>

<div class="example">
Expand Down

0 comments on commit 3ef7992

Please sign in to comment.