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

Commit

Permalink
Issue #55: Clarify prose around termination
Browse files Browse the repository at this point in the history
  • Loading branch information
Lars T Hansen committed Mar 9, 2016
1 parent eb2c6be commit e97c8ae
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 17 deletions.
42 changes: 33 additions & 9 deletions tc39/agents-formatted.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<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>

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

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

<p>Changelog:</p>
<ul>
<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).
<li> 2016-03-09 -- Agent termination semantics clarified.

</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).

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

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

<p> An embedding may terminate an agent without any
of the agent's cluster's other agents' prior knowledge or cooperation. If the
embedding terminates an agent it must make it possible for any other agents
in the terminated agent's cluster that continue to run to discover the
termination. </p>

<emu-note><span class="note">Note 5</span>
<p> Examples of that type of termination are: operating systems
or users terminating agents that are running in separate
processes; the embedding itself terminating an agent that is
running in-process with the other agents when per-agent
resource accounting indicates that the agent is runaway. </p>
</emu-note>

<emu-note><span class="note">Note 6</span>
<p> (Spec draft note) The requirement that the embedding must
make the termination known to other agents is actually very
soft. The shared memory spec will require that detecing
termination creates the necessary happens-before edge in the
memory ordering, which is a tougher requirement. The web
platform provides nothing at the moment to detect
termination. </p>

<p> In current browsers, given that dedicated workers are
in-process, an agent cluster will normally terminate en masse,
so the requirement is trivially satisfied for now. </p>
</emu-note>

</emu-clause> <!-- agent cluster -->

<emu-clause id="ExecutableCodeAndContexts.AgentCommunication">
Expand All @@ -338,13 +368,7 @@ <h1><span class="secnum">1.6</span>External suspension of agents (NEW)<span clas
<emu-clause id="ExecutableCodeAndContexts.ExternalTermination">
<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>

<p> An embedding may terminate agents without the agents' knowledge. If it does that, then: </p>

<p> <b>TODO</b> </p>

<emu-note><span class="note">Note</span>
<p> The reasons for termination include resource exhaustion and embedding-specific agent management. </p>
</emu-note>
<p> (Integrated into the Agent Clusters section; section kept to avoid changing the numbering) </p>

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

Expand Down
39 changes: 31 additions & 8 deletions tc39/agents.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

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

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

<emu-intro id="intro">
<h1>Introduction</h1>
Expand Down Expand Up @@ -60,6 +60,7 @@ <h1>Introduction</h1>

<p>Changelog:</p>
<ul>
<li> 2016-03-09 -- Agent termination semantics clarified.
<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).
<li> 2016-03-04 -- Removed the contents of the section on inter-agent communication because it was not relevant to this spec.
<li> 2016-03-04 -- Removed wording about the kinds of objects that agents and agent clusters could be reified as.
Expand Down Expand Up @@ -305,6 +306,34 @@ <h1>Agent Clusters (NEW)</h1>
turn, places interesting demands on the structured clone algorithm in web browsers. </p>
</emu-note>

<p> An embedding may terminate an agent without any
of the agent's cluster's other agents' prior knowledge or cooperation. If the
embedding terminates an agent it must make it possible for any other agents
in the terminated agent's cluster that continue to run to discover the
termination. </p>

<emu-note>
<p> Examples of that type of termination are: operating systems
or users terminating agents that are running in separate
processes; the embedding itself terminating an agent that is
running in-process with the other agents when per-agent
resource accounting indicates that the agent is runaway. </p>
</emu-note>

<emu-note>
<p> (Spec draft note) The requirement that the embedding must
make the termination known to other agents is actually very
soft. The shared memory spec will require that detecing
termination creates the necessary happens-before edge in the
memory ordering, which is a tougher requirement. The web
platform provides nothing at the moment to detect
termination. </p>

<p> In current browsers, given that dedicated workers are
in-process, an agent cluster will normally terminate en masse,
so the requirement is trivially satisfied for now. </p>
</emu-note>

</emu-clause> <!-- agent cluster -->

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

<p> An embedding may terminate agents without the agents' knowledge. If it does that, then: </p>

<p> <b>TODO</b> </p>

<emu-note>
<p> The reasons for termination include resource exhaustion and embedding-specific agent management. </p>
</emu-note>
<p> (Integrated into the Agent Clusters section; section kept to avoid changing the numbering) </p>

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

Expand Down

0 comments on commit e97c8ae

Please sign in to comment.