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

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

--- ai12s/ai12-0266-1.txt	2018/10/17 04:36:32	1.7
+++ ai12s/ai12-0266-1.txt	2018/10/17 22:33:36	1.8
@@ -1,4 +1,4 @@
-!standard 5.5.1(4/3)                                  18-10-14  AI12-0266-1/05
+!standard 5.5.1(4/3)                                  18-10-16  AI12-0266-1/06
 !standard 5.5.1(6/4)
 !standard 5.5.1(11/3)
 !standard 5.5.2(4/3)
@@ -46,10 +46,10 @@
 
 A parallel iterator provides a Split_Into_Chunks procedure that can be used to
 associate with the iterator a set of cursors that define the chunk boundaries
-for parallel iteration. Each cursor is assigned to a different logical thread of
-control and identifies the first element of a different chunk of iterations
-where each chunk can be iterated through in parallel with other chunks to
-collectively cover all the elements of the container.
+for parallel iteration. Each cursor can be assigned to a different logical
+thread of control and identifies the first element of a different chunk of
+iterations where each chunk can be iterated through in parallel with other
+chunks to collectively cover all the elements of the container.
 
 The starting cursor for each chunk of iteration can be obtained by calling the
 Start_Of_Chunk operation, passing in the chunk index of the split as a parameter
@@ -69,35 +69,17 @@
    | [parallel] for loop_parameter_specification
    | [parallel] for iterator_specification
 
-Modify 5.5.1 (2/5 - 4/3)
-
-generic
-   type Cursor;
-   with function Has_Element (Position : Cursor) return Boolean;
-package Ada.Iterator_Interfaces
-   with Pure[, Nonblocking => False] is
-
-   type Forward_Iterator is limited interface {with Nonblocking => False};
-   function First (Object : Forward_Iterator) return Cursor is abstract;
-   function Next (Object : Forward_Iterator; Position : Cursor)
-      return Cursor is abstract;
-
-   type Reversible_Iterator is limited interface and Forward_Iterator
-     {with Nonblocking => False};  [Author: Redundant since inherited]
-   function Last (Object : Reversible_Iterator) return Cursor is abstract;
-   function Previous (Object : Reversible_Iterator; Position : Cursor)
-      return Cursor is abstract;
-
 Add after 5.5.1(4/3)
 
    type Iteration_Count_Type is mod System.Max_Binary_Modulus;
 
    type Parallel_Iterator is limited interface and Forward_Iterator
-      with Nonblocking;
+     with Nonblocking;
 
    function Iterations
      (Object : Parallel_Iterator)
-      return Iteration_Count_Type is abstract;
+      return Iteration_Count_Type is abstract
+     with Nonblocking;
 
    subtype Cursor_Count is Positive;
    subtype Chunk_Index is Positive;
@@ -105,27 +87,57 @@
    procedure Split_Into_Chunks
      (Object        : in out Parallel_Iterator;
       Maximum_Split : Cursor_Count) is abstract
-     with Pre'Class =>
-       Iteration_Count_Type (Maximum_Split) <= Object.Iterations,
+     with Nonblocking,
+          Pre'Class =>
+            Iteration_Count_Type (Maximum_Split) <= Object.Iterations,
           Post'Class => Object.Chunk_Count <= Maximum_Split;
 
    function Chunk_Count
-     (Object  : Parallel_Iterator) return Cursor_Count is abstract;
+     (Object  : Parallel_Iterator) return Cursor_Count is abstract
+      with Nonblocking;
 
    function Start_Of_Chunk
      (Object : Parallel_Iterator;
       Chunk  : Chunk_Index) return Cursor is abstract
-     with Pre'Class => Chunk <= Object.Chunk_Count;
+     with Nonblocking,
+          Pre'Class => Chunk <= Object.Chunk_Count;
 
    function Chunk_Finished
      (Object   : Parallel_Iterator;
       Chunk    : Chunk_Index;
       Position : Cursor) return Boolean is abstract
-     with Pre'Class => Chunk <= Object.Chunk_Count;
+     with Nonblocking,
+          Pre'Class => Chunk <= Object.Chunk_Count;
+
+   overriding
+   function First
+     (Object : Parallel_Iterator) return Cursor is abstract
+     with Nonblocking;
+
+   overriding
+   function Next
+     (Object   : Forward_Iterator;
+      Position : Cursor) return Cursor is abstract
+     with Nonblocking;
+
+   [Editor's note: We need the above overridings to make these routines
+   Nonblocking, else they would allow blocking as inherited from their
+   ancestors.]
 
    type Parallel_Reversible_Iterator is limited interface
      and Parallel_Iterator and Reversible_Iterator with Nonblocking;
 
+   overriding
+   function Last
+     (Object : Parallel_Reversible_Iterator) return Cursor is abstract
+     with Nonblocking;
+
+   overriding
+   function Previous
+     (Object   : Reversible_Iterator;
+      Position : Cursor) return Cursor is abstract
+     with Nonblocking;
+
 Modify 5.5.1(6/3)
 
 An iterator type is a type descended from the Forward_Iterator
@@ -134,14 +146,13 @@
 instance of Ada.Iterator_Interfaces. {A parallel iterator type is a type
 descended from the Parallel_Iterator interface from some instance of
 Ada.Iterator_Interfaces. A parallel reversible iterator type is a type descended
-from the Parallel_Iterator interface and the Reversible_Iterator interface
-from some instance of Ada.Iterator_Interfaces.} An iterator object is an object
-of an iterator type. A reversible iterator object is an object of a reversible
-iterator type. { A parallel iterator object is an object of a parallel iterator
-type. A parallel reversible iterator object is an object of a parallel
-reversible iterator type.} The formal subtype Cursor from the associated
-instance of Ada.Iterator_Interfaces is the iteration cursor subtype for the
-iterator type.
+from the Parallel_Reversible_Iterator interface from some instance of
+Ada.Iterator_Interfaces.} An iterator object is an object of an iterator type. A
+reversible iterator object is an object of a reversible iterator type. {A
+parallel iterator object is an object of a parallel iterator type. A parallel
+reversible iterator object is an object of a parallel reversible iterator type.}
+The formal subtype Cursor from the associated instance of
+Ada.Iterator_Interfaces is the iteration cursor subtype for the iterator type.
 
 Modify 5.5.1(11/3)
 
@@ -244,7 +255,7 @@
 iterator type is then called, with the Maximum_Split parameter specified as the
 upper bound for the number of loop parameter objects to be associated with the
 iterator. The number of loop parameters that were created is determined by
-calling the Chunk_Count operation of the iterator. Each loop parameter is
+calling the Chunk_Count operation of the iterator. Each loop parameter can be
 assigned to a different logical thread of control, with an ordinal chunk index
 value. The Initial cursor values to be associated with each loop parameter is
 determined by calling the Start_Of_Chunk operation of the iterator using the
@@ -328,7 +339,7 @@
 then called, with the Maximum_Split parameter specified as the upper bound for
 the number of loop parameter objects to be associated with the iterator. The
 number of loop parameters that were created is determined by calling the
-Chunk_Count operation of the iterator. Each loop parameter is assigned to a
+Chunk_Count operation of the iterator. Each loop parameter can be assigned to a
 different logical thread of control, with an ordinal chunk index value. The
 Initial cursor values to be associated with each loop parameter is determined by
 calling the Start_Of_Chunk operation of the iterator using the chunk index value

Questions? Ask the ACAA Technical Agent