CVS difference for ai12s/ai12-0279-1.txt

Differences between 1.6 and version 1.7
Log of other versions for file ai12s/ai12-0279-1.txt

--- ai12s/ai12-0279-1.txt	2018/10/18 23:12:54	1.6
+++ ai12s/ai12-0279-1.txt	2018/11/27 08:05:27	1.7
@@ -1,6 +1,8 @@
-!standard D.2.1(1.5/2)                                18-10-18  AI12-0279-1/03
-!standard D.2.1(8/2)
+!standard D.2.1(1.5/2)                                18-10-22  AI12-0279-1/04
+!standard D.2.1(7/5)
 !class binding interpretation 18-05-14
+!status Amendment 1-2012 18-11-26
+!status ARG Approved 9-0-1 18-10-22
 !status work item 18-05-14
 !status received 18-05-11
 !priority Medium
@@ -10,8 +12,8 @@
 
 !summary
 
-All potentially blocking operations are preemption points for the
-Non-Preemptive Dispatching Policy.
+A Yield aspect is provided to ensure that the associated subprogram encounters
+at least one task dispatching point during each invocation.
 
 !question
 
@@ -37,16 +39,14 @@
 returning from the call, then a task dispatching point is inserted before the
 return. This simple change would make non-preemptive dispatching more
 predictable, while giving the programmer better control for placing the extra
-task dispatching points. All language defined subprograms that have the
-Non_Blocking aspect as False, except for the IO related calls, will be updated
-to specify Yield as True.
+task dispatching points.
 
 !wording
 
-Add after D.2.1 (1.5/2)
+Add after D.2.1(1.5/2)
 
 For a noninstance subprogram (including a generic formal subprogram),
-a generic subprogram, or an entry, the following language-defined aspect 
+a generic subprogram, or an entry, the following language-defined aspect
 may be specified with an aspect_specification (see 13.1.1):
 
 Yield
@@ -55,27 +55,28 @@
    If directly specified, the aspect_definition shall be a static expression.
    If not specified (including by inheritance), the aspect is False.
 
-   If a Yield aspect is specified True for a primitive subprogram S of a tagged
-   type T, then the aspect is inherited by descendants of T (including the
-   class-wide type T'Class). {If the Yield aspect is specified for a
-   subprogram which inherits the value of the aspect, the specified value 
-   shall be confirming.}
-
-Add after D.2.1 (8.2)
-
-The Yield aspect specifies that a task dispatching point will be reached
-prior to returning from a call for a callable entity or an
-access-to-subprogram type.
-An implicit call to Yield is issued prior to returning from a call if a
-task dispatching point is not reached at some point during the call by
-the logical thread of control that issued the call.
+   If a Yield aspect is specified True for a primitive subprogram S of a
+   type T, then the aspect is inherited by the corresponding primitive
+   subprogram of each descendant of T. If the Yield aspect is specified
+   for a dispatching subprogram that inherits the aspect, the specified
+   value shall be confirming. If the Nonblocking aspect (see 9.5) of
+   the associated callable entity is statically True, the Yield aspect
+   shall not be specified as True.
+
+Add after D.2.1(7/5)
+
+If the Yield aspect has the value True, then a call to Yield is included
+within the body of the associated callable entity, and invoked
+immediately prior to returning from the body if and only if no other
+task dispatching points were encountered during the execution of the
+body.
 
 !discussion
 
 We considered having potentially blocking operations be task dispatching points,
 but that raised the possibility that low-level subprograms such as IO calls that
 normally do not block could generate excessive overhead if they were to yield
-on every call. In contrast, this approach gives better control to the programmer 
+on every call. In contrast, this approach gives better control to the programmer
 to specify where extra task dispatching points should be placed.
 
 We considered specifying the Yield aspect on some of the language-defined
@@ -87,6 +88,47 @@
 task dispatching points on any of the language defined subprograms could add
 unnecessary overhead where it was not needed.
 
+One possible implementation model would be to declare a local constant
+initialized by copying a per-task count of task dispatching points, and then
+immediately prior to returning from the subprogram, a call to the Yield
+operation is performed if the per-task count has not changed. This count would
+presumably be represented as a modular type to avoid overflow.
+
+!corrigendum D.2.1(1.5/2)
+
+@dinsa
+Dispatching serves as the parent of other language-defined library
+units concerned with task dispatching.
+@dinss
+For a noninstance subprogram (including a generic formal subprogram),
+a generic subprogram, or an entry, the following language-defined aspect
+may be specified with an @fa<aspect_specification> (see 13.1.1):
+
+@xhang<@xterm<Yield>
+The type of aspect Yield is Boolean.>
+
+@xindent<If directly specified, the @fa<aspect_definition> shall be a static 
+expression. If not specified (including by inheritance), the aspect is False.>
+
+@xindent<If a Yield aspect is specified True for a primitive subprogram @i<S> 
+of a type @i<T>, then the aspect is inherited by the corresponding primitive
+subprogram of each descendant of @i<T>. If the Yield aspect is specified
+for a dispatching subprogram that inherits the aspect, the specified
+value shall be confirming. If the Nonblocking aspect (see 9.5) of
+the associated callable entity is statically True, the Yield aspect
+shall not be specified as True.>
+
+!corrigendum D.2.1(7/5)
+
+@dinsa
+A call of Yield is a task dispatching point.
+@dinst
+If the Yield aspect has the value True, then a call to Yield is included
+within the body of the associated callable entity, and invoked
+immediately prior to returning from the body if and only if no other
+task dispatching points were encountered during the execution of the
+body.
+
 !ASIS
 
 No ASIS effect.
@@ -564,7 +606,7 @@
 >I added the following paragraph (stolen from aspect Pack) to the AI wording:
 >
 >If directly specified, the aspect_definition shall be a static expression.
->If not specified (including by inheritance), the aspect is False. 
+>If not specified (including by inheritance), the aspect is False.
 >
 >You didn't mention the first part, but you must be intending that based on
 >the rest of the text.
@@ -575,9 +617,9 @@
 >Probably this should either be replaced by what you mean. Maybe add it to
 >the preceding paragraph:
 >   If a Yield aspect is specified True for a primitive subprogram S of a
->   tagged type T, then the aspect is inherited by descendants of T (including 
+>   tagged type T, then the aspect is inherited by descendants of T (including
 >   the class-wide type T'Class). {If the Yield aspect is specified for a
->   subprogram which inherits the value of the aspect, the specified value 
+>   subprogram which inherits the value of the aspect, the specified value
 >   shall be confirming.}
 
 Yes, your proposed addition does what I and the IRTAW group meant.
@@ -588,8 +630,8 @@
 >add a Yield call manually. (I don't see this coming up often!)
 
 ---
-I appreciate the wisdom of avoiding unwanted overhead. 
-I suppose we can live with not including access-to-subprograms to this ruling 
+I appreciate the wisdom of avoiding unwanted overhead.
+I suppose we can live with not including access-to-subprograms to this ruling
 and let the programmer handle those cases manually.
 
 ****************************************************************

Questions? Ask the ACAA Technical Agent