Skip to content
This repository was archived by the owner on Jan 25, 2022. It is now read-only.

Commit e97c8ae

Browse files
author
Lars T Hansen
committed
Issue #55: Clarify prose around termination
1 parent eb2c6be commit e97c8ae

File tree

2 files changed

+64
-17
lines changed

2 files changed

+64
-17
lines changed

tc39/agents-formatted.html

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<script type="application/json" id="menu-search-biblio">{"clauses":{"intro":{"location":"","id":"intro","aoid":null,"title":"Introduction","number":""},"ExecutableCodeAndContexts":{"location":"","id":"ExecutableCodeAndContexts","aoid":null,"title":"Executable Code and Execution Contexts (ES6 8)","number":"1"},"ExecutableCodeAndContexts.ExecutionContexts":{"location":"","id":"ExecutableCodeAndContexts.ExecutionContexts","aoid":null,"title":"Execution contexts (ES6 8.3)","number":"1.1"},"ExecutableCodeAndContexts.JobsAndJobQueues":{"location":"","id":"ExecutableCodeAndContexts.JobsAndJobQueues","aoid":null,"title":"Jobs and Job Queues (ES6 8.4)","number":"1.2"},"ExecutableCodeAndContexts.JobsAndJobQueues.Progress":{"location":"","id":"ExecutableCodeAndContexts.JobsAndJobQueues.Progress","aoid":null,"title":"Forward Progress Guarantees","number":"1.2.1"},"ExecutableCodeAndContexts.Agent":{"location":"","id":"ExecutableCodeAndContexts.Agent","aoid":null,"title":"Agents (NEW)","number":"1.3"},"ExecutableCodeAndContexts.AgentCluster":{"location":"","id":"ExecutableCodeAndContexts.AgentCluster","aoid":null,"title":"Agent Clusters (NEW)","number":"1.4"},"ExecutableCodeAndContexts.AgentCommunication":{"location":"","id":"ExecutableCodeAndContexts.AgentCommunication","aoid":null,"title":"Inter-Agent Communication (NEW)","number":"1.5"},"ExecutableCodeAndContexts.ExternalSuspension":{"location":"","id":"ExecutableCodeAndContexts.ExternalSuspension","aoid":null,"title":"External suspension of agents (NEW)","number":"1.6"},"ExecutableCodeAndContexts.ExternalTermination":{"location":"","id":"ExecutableCodeAndContexts.ExternalTermination","aoid":null,"title":"External termination of agents (NEW)","number":"1.7"},"StructuredData":{"location":"","id":"StructuredData","aoid":null,"title":"Structured Data (ES6 24)","number":"2"},"StructuredData.ArrayBuffer":{"location":"","id":"StructuredData.ArrayBuffer","aoid":null,"title":"ArrayBuffer Objects (ES6 24.1)","number":"2.1"},"StructuredData.ArrayBuffer.abstract":{"location":"","id":"StructuredData.ArrayBuffer.abstract","aoid":null,"title":"Abstract Operations for ArrayBuffer (ES6 24.1.1)","number":"2.1.1"},"StructuredData.ArrayBuffer.abstract.GetValueFromBuffer":{"location":"","id":"StructuredData.ArrayBuffer.abstract.GetValueFromBuffer","aoid":"GetValueFromBuffer","title":"GetValueFromBuffer( arrayBuffer, byteIndex, type [, isLittleEndian] ) (ES6 24.1.1.5)","number":"2.1.1.1"},"StructuredData.ArrayBuffer.abstract.SetValueInBuffer":{"location":"","id":"StructuredData.ArrayBuffer.abstract.SetValueInBuffer","aoid":"SetValueInBuffer","title":"SetValueInBuffer( arrayBuffer, byteIndex, type, value [, isLittleEndian] ) (ES6 24.1.1.6)","number":"2.1.1.2"},"WebBrowserEmbedding":{"location":"","id":"WebBrowserEmbedding","aoid":null,"title":"Web browser embedding (for the HTML/DOM spec)","number":"3"},"WebBrowserEmbedding.Agents":{"location":"","id":"WebBrowserEmbedding.Agents","aoid":null,"title":"Agent mapping","number":"3.1"},"WebBrowserEmbedding.WorkerSemantics":{"location":"","id":"WebBrowserEmbedding.WorkerSemantics","aoid":null,"title":"Clarifications and changes to Web Worker semantics","number":"3.2"},"WebBrowserEmbedding.WorkerSemantics.Start":{"location":"","id":"WebBrowserEmbedding.WorkerSemantics.Start","aoid":null,"title":"Actions to start a worker","number":"3.2.1"},"WebBrowserEmbedding.WorkerSemantics.Jobs":{"location":"","id":"WebBrowserEmbedding.WorkerSemantics.Jobs","aoid":null,"title":"Workers are agents","number":"3.2.2"},"WebBrowserEmbedding.WorkerSemantics.LicenseToKill":{"location":"","id":"WebBrowserEmbedding.WorkerSemantics.LicenseToKill","aoid":null,"title":"Curtail the license to kill","number":"3.2.3"},"WebBrowserEmbedding.WorkerSemantics.Introspection":{"location":"","id":"WebBrowserEmbedding.WorkerSemantics.Introspection","aoid":null,"title":"Termination detection","number":"3.2.4"},"WebBrowserEmbedding.Termination":{"location":"","id":"WebBrowserEmbedding.Termination","aoid":null,"title":"Agent termination","number":"3.3"}},"ops":{"GetValueFromBuffer":{"aoid":"GetValueFromBuffer","id":"StructuredData.ArrayBuffer.abstract.GetValueFromBuffer","location":""},"SetValueInBuffer":{"aoid":"SetValueInBuffer","id":"StructuredData.ArrayBuffer.abstract.SetValueInBuffer","location":""}},"productions":{},"terms":{},"examples":{},"notes":{},"tables":{},"figures":{}}</script></head><body><div id="menu-toggle">☰</div><div id="menu"><div id="menu-search"><input type="text" id="menu-search-box" placeholder="Search..."><div id="menu-search-results" class="inactive"></div></div><div id="menu-toc"><ol class="toc"><li><span class="item-toggle-none"></span><a href="#intro" title="Introduction"><span class="secnum"></span> Introduction</a></li><li><span class="item-toggle">◢</span><a href="#ExecutableCodeAndContexts" title="Executable Code and Execution Contexts (ES6 8)"><span class="secnum">1</span> Executable Code and Execution Contexts (ES6 8)</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#ExecutableCodeAndContexts.ExecutionContexts" title="Execution contexts (ES6 8.3)"><span class="secnum">1.1</span> Execution contexts (ES6 8.3)</a></li><li><span class="item-toggle">◢</span><a href="#ExecutableCodeAndContexts.JobsAndJobQueues" title="Jobs and Job Queues (ES6 8.4)"><span class="secnum">1.2</span> Jobs and Job Queues (ES6 8.4)</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#ExecutableCodeAndContexts.JobsAndJobQueues.Progress" title="Forward Progress Guarantees"><span class="secnum">1.2.1</span> Forward Progress Guarantees</a></li></ol></li><li><span class="item-toggle-none"></span><a href="#ExecutableCodeAndContexts.Agent" title="Agents (NEW)"><span class="secnum">1.3</span> Agents (NEW)</a></li><li><span class="item-toggle-none"></span><a href="#ExecutableCodeAndContexts.AgentCluster" title="Agent Clusters (NEW)"><span class="secnum">1.4</span> Agent Clusters (NEW)</a></li><li><span class="item-toggle-none"></span><a href="#ExecutableCodeAndContexts.AgentCommunication" title="Inter-Agent Communication (NEW)"><span class="secnum">1.5</span> Inter-Agent Communication (NEW)</a></li><li><span class="item-toggle-none"></span><a href="#ExecutableCodeAndContexts.ExternalSuspension" title="External suspension of agents (NEW)"><span class="secnum">1.6</span> External suspension of agents (NEW)</a></li><li><span class="item-toggle-none"></span><a href="#ExecutableCodeAndContexts.ExternalTermination" title="External termination of agents (NEW)"><span class="secnum">1.7</span> External termination of agents (NEW)</a></li></ol></li><li><span class="item-toggle">◢</span><a href="#StructuredData" title="Structured Data (ES6 24)"><span class="secnum">2</span> Structured Data (ES6 24)</a><ol class="toc"><li><span class="item-toggle">◢</span><a href="#StructuredData.ArrayBuffer" title="ArrayBuffer Objects (ES6 24.1)"><span class="secnum">2.1</span> ArrayBuffer Objects (ES6 24.1)</a><ol class="toc"><li><span class="item-toggle">◢</span><a href="#StructuredData.ArrayBuffer.abstract" title="Abstract Operations for ArrayBuffer (ES6 24.1.1)"><span class="secnum">2.1.1</span> Abstract Operations for ArrayBuffer (ES6 24.1.1)</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#StructuredData.ArrayBuffer.abstract.GetValueFromBuffer" title="GetValueFromBuffer( arrayBuffer, byteIndex, type [, isLittleEndian] ) (ES6 24.1.1.5)"><span class="secnum">2.1.1.1</span> GetValueFromBuffer( arrayBuffer, byteIndex, type [, isLittleEndian] ) (ES6 24.1.1.5)</a></li><li><span class="item-toggle-none"></span><a href="#StructuredData.ArrayBuffer.abstract.SetValueInBuffer" title="SetValueInBuffer( arrayBuffer, byteIndex, type, value [, isLittleEndian] ) (ES6 24.1.1.6)"><span class="secnum">2.1.1.2</span> SetValueInBuffer( arrayBuffer, byteIndex, type, value [, isLittleEndian] ) (ES6 24.1.1.6)</a></li></ol></li></ol></li></ol></li><li><span class="item-toggle">◢</span><a href="#WebBrowserEmbedding" title="Web browser embedding (for the HTML/DOM spec)"><span class="secnum">3</span> Web browser embedding (for the HTML/DOM spec)</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#WebBrowserEmbedding.Agents" title="Agent mapping"><span class="secnum">3.1</span> Agent mapping</a></li><li><span class="item-toggle">◢</span><a href="#WebBrowserEmbedding.WorkerSemantics" title="Clarifications and changes to Web Worker semantics"><span class="secnum">3.2</span> Clarifications and changes to Web Worker semantics</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#WebBrowserEmbedding.WorkerSemantics.Start" title="Actions to start a worker"><span class="secnum">3.2.1</span> Actions to start a worker</a></li><li><span class="item-toggle-none"></span><a href="#WebBrowserEmbedding.WorkerSemantics.Jobs" title="Workers are agents"><span class="secnum">3.2.2</span> Workers are agents</a></li><li><span class="item-toggle-none"></span><a href="#WebBrowserEmbedding.WorkerSemantics.LicenseToKill" title="Curtail the license to kill"><span class="secnum">3.2.3</span> Curtail the license to kill</a></li><li><span class="item-toggle-none"></span><a href="#WebBrowserEmbedding.WorkerSemantics.Introspection" title="Termination detection"><span class="secnum">3.2.4</span> Termination detection</a></li></ol></li><li><span class="item-toggle-none"></span><a href="#WebBrowserEmbedding.Termination" title="Agent termination"><span class="secnum">3.3</span> Agent termination</a></li></ol></li></ol></div></div><h1>DOM/ECMAScript "Agents"</h1>
99

10-
<p> Second draft. Revised: 2016-03-04. [email protected] </p>
10+
<p> Second draft. Revised: 2016-03-09. [email protected] </p>
1111

1212
<emu-intro id="intro">
1313
<h1><span class="secnum"></span>Introduction<span class="utils"><span class="anchor"><a href="#intro">#</a></span></span></h1>
@@ -57,7 +57,9 @@ <h1><span class="secnum"></span>Introduction<span class="utils"><span class="anc
5757

5858
<p>Changelog:</p>
5959
<ul>
60-
<li> 2016-03-04 -- Changed the definition of agent clusters back to the old one where a cluster is monotonically growing. Integrated several comments and cleaned up. Removed the contents of the section on agent suspension (by moving it into other sections).
60+
<li> 2016-03-09 -- Agent termination semantics clarified.
61+
62+
</li><li> 2016-03-04 -- Changed the definition of agent clusters back to the old one where a cluster is monotonically growing. Integrated several comments and cleaned up. Removed the contents of the section on agent suspension (by moving it into other sections).
6163

6264
</li><li> 2016-03-04 -- Removed the contents of the section on inter-agent communication because it was not relevant to this spec.
6365

@@ -319,6 +321,34 @@ <h1><span class="secnum">1.4</span>Agent Clusters (NEW)<span class="utils"><span
319321
turn, places interesting demands on the structured clone algorithm in web browsers. </p>
320322
</emu-note>
321323

324+
<p> An embedding may terminate an agent without any
325+
of the agent's cluster's other agents' prior knowledge or cooperation. If the
326+
embedding terminates an agent it must make it possible for any other agents
327+
in the terminated agent's cluster that continue to run to discover the
328+
termination. </p>
329+
330+
<emu-note><span class="note">Note 5</span>
331+
<p> Examples of that type of termination are: operating systems
332+
or users terminating agents that are running in separate
333+
processes; the embedding itself terminating an agent that is
334+
running in-process with the other agents when per-agent
335+
resource accounting indicates that the agent is runaway. </p>
336+
</emu-note>
337+
338+
<emu-note><span class="note">Note 6</span>
339+
<p> (Spec draft note) The requirement that the embedding must
340+
make the termination known to other agents is actually very
341+
soft. The shared memory spec will require that detecing
342+
termination creates the necessary happens-before edge in the
343+
memory ordering, which is a tougher requirement. The web
344+
platform provides nothing at the moment to detect
345+
termination. </p>
346+
347+
<p> In current browsers, given that dedicated workers are
348+
in-process, an agent cluster will normally terminate en masse,
349+
so the requirement is trivially satisfied for now. </p>
350+
</emu-note>
351+
322352
</emu-clause> <!-- agent cluster -->
323353

324354
<emu-clause id="ExecutableCodeAndContexts.AgentCommunication">
@@ -338,13 +368,7 @@ <h1><span class="secnum">1.6</span>External suspension of agents (NEW)<span clas
338368
<emu-clause id="ExecutableCodeAndContexts.ExternalTermination">
339369
<h1><span class="secnum">1.7</span>External termination of agents (NEW)<span class="utils"><span class="anchor"><a href="#ExecutableCodeAndContexts.ExternalTermination">#</a></span></span></h1>
340370

341-
<p> An embedding may terminate agents without the agents' knowledge. If it does that, then: </p>
342-
343-
<p> <b>TODO</b> </p>
344-
345-
<emu-note><span class="note">Note</span>
346-
<p> The reasons for termination include resource exhaustion and embedding-specific agent management. </p>
347-
</emu-note>
371+
<p> (Integrated into the Agent Clusters section; section kept to avoid changing the numbering) </p>
348372

349373
</emu-clause> <!-- external termination -->
350374

tc39/agents.html

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
<h1>DOM/ECMAScript "Agents"</h1>
1313

14-
<p> Second draft. Revised: 2016-03-04. [email protected] </p>
14+
<p> Second draft. Revised: 2016-03-09. [email protected] </p>
1515

1616
<emu-intro id="intro">
1717
<h1>Introduction</h1>
@@ -60,6 +60,7 @@ <h1>Introduction</h1>
6060

6161
<p>Changelog:</p>
6262
<ul>
63+
<li> 2016-03-09 -- Agent termination semantics clarified.
6364
<li> 2016-03-04 -- Changed the definition of agent clusters back to the old one where a cluster is monotonically growing. Integrated several comments and cleaned up. Removed the contents of the section on agent suspension (by moving it into other sections).
6465
<li> 2016-03-04 -- Removed the contents of the section on inter-agent communication because it was not relevant to this spec.
6566
<li> 2016-03-04 -- Removed wording about the kinds of objects that agents and agent clusters could be reified as.
@@ -305,6 +306,34 @@ <h1>Agent Clusters (NEW)</h1>
305306
turn, places interesting demands on the structured clone algorithm in web browsers. </p>
306307
</emu-note>
307308

309+
<p> An embedding may terminate an agent without any
310+
of the agent's cluster's other agents' prior knowledge or cooperation. If the
311+
embedding terminates an agent it must make it possible for any other agents
312+
in the terminated agent's cluster that continue to run to discover the
313+
termination. </p>
314+
315+
<emu-note>
316+
<p> Examples of that type of termination are: operating systems
317+
or users terminating agents that are running in separate
318+
processes; the embedding itself terminating an agent that is
319+
running in-process with the other agents when per-agent
320+
resource accounting indicates that the agent is runaway. </p>
321+
</emu-note>
322+
323+
<emu-note>
324+
<p> (Spec draft note) The requirement that the embedding must
325+
make the termination known to other agents is actually very
326+
soft. The shared memory spec will require that detecing
327+
termination creates the necessary happens-before edge in the
328+
memory ordering, which is a tougher requirement. The web
329+
platform provides nothing at the moment to detect
330+
termination. </p>
331+
332+
<p> In current browsers, given that dedicated workers are
333+
in-process, an agent cluster will normally terminate en masse,
334+
so the requirement is trivially satisfied for now. </p>
335+
</emu-note>
336+
308337
</emu-clause> <!-- agent cluster -->
309338

310339
<emu-clause id="ExecutableCodeAndContexts.AgentCommunication">
@@ -324,13 +353,7 @@ <h1>External suspension of agents (NEW)</h1>
324353
<emu-clause id="ExecutableCodeAndContexts.ExternalTermination">
325354
<h1>External termination of agents (NEW)</h1>
326355

327-
<p> An embedding may terminate agents without the agents' knowledge. If it does that, then: </p>
328-
329-
<p> <b>TODO</b> </p>
330-
331-
<emu-note>
332-
<p> The reasons for termination include resource exhaustion and embedding-specific agent management. </p>
333-
</emu-note>
356+
<p> (Integrated into the Agent Clusters section; section kept to avoid changing the numbering) </p>
334357

335358
</emu-clause> <!-- external termination -->
336359

0 commit comments

Comments
 (0)