CVS difference for ai05s/ai05-0251-1.txt

Differences between 1.1 and version 1.2
Log of other versions for file ai05s/ai05-0251-1.txt

--- ai05s/ai05-0251-1.txt	2011/06/16 00:00:47	1.1
+++ ai05s/ai05-0251-1.txt	2011/07/21 02:59:30	1.2
@@ -1,6 +1,8 @@
-!standard A.18.30(0)                              11-06-15    AI05-0251-1/01
-!standard A.18.28(0)
+!standard A.18.27(0)                              11-07-20    AI05-0251-1/02
+!standard A.18.30(0)
+!standard A.18.31(0)
 !class Amendment 11-06-15
+!status ARG Approved 11-0-1  11-06-25
 !status work item 11-06-15
 !status received 11-06-13
 !priority Medium
@@ -8,8 +10,10 @@
 !subject Problems with queue containers
 !summary
 
-TBD.
+There are no indefinite versions of the queue containers.
 
+Dequeue_Only_High_Priority is non-blocking.
+
 !question
 
 (1) It seems very hard to use the indefinite version of Dequeue, since it
@@ -26,25 +30,94 @@
 
 !proposal
 
-** TBD.
+(See wording.)
 
 !wording
 
-** TBD.
+For (1), remove A.18.32 (the indefinite queues).
 
-!discussion
+Add a user note at the end of A.18.27:
 
-** TBD.
+   Note: Unlike other language-defined containers, there are no queues whose
+   element types are indefinite. Elements of an indefinite type can be handled
+   by defining the element of the queue to be a holder container (see A.18.18)
+   of the indefinite type, or to be an explicit access type that designates
+   the indefinite type.
+
+   AARM Reason: There are no indefinite queues as a useful definition for Dequeue
+   is not possible. Dequeue cannot be a function as Ada does not have entries
+   that are functions (thus conditional and timed calls would not be possible)
+   and moreover protected functions do not allow modifying the queue object (thus it
+   doesn't work even if we decided we didn't care about conditional and timed calls).
+   If Dequeue is an entry, then the dequeued object would have to be an *out* parameter
+   and that would require the queue client to guess the tag and constraints of the value
+   that will be dequeued (otherwise Constraint_Error would be raised), and that is
+   rarely going to be possible.
+
+For (2) and (3), replace A.18.30(6/3) and A.18.31(6/3) by:
+
+   not overriding
+   procedure Dequeue_Only_High_Priority
+      (At_Least : in     Queue_Priority;
+       Element  : in out Queue_Interfaces.Element_Type;
+       Success  :    out Boolean);
+
+Replace A.18.30(17/3):
+
+   For a call on Dequeue_Only_High_Priority, if the head of the non-empty queue is E, and
+   the function Before(At_Least, Get_Priority(E)) returns False, then E is assigned to
+   Element and then removed from the queue, and Success is set to True; otherwise Success is
+   set to False and Element is unchanged.
+
+   AARM Ramification: Unlike Dequeue, Dequeue_Only_High_Priority is not blocking; it always
+   returns immediately.
+
+   AARM Reason: The use of Before is "backwards" so that it acts like ">=" (it is defined
+   similarly to ">"); thus we dequeue only when it is False.
+
+Modify A.18.27(12/3) to use wording consistent with the above:
+
+   If the queue is empty, then Dequeue blocks until an item becomes available. In any case,
+   it then [returns a copy of]{assigns} the element at the head of the queue {to Element},
+   and removes it from the [container]{queue}.
+
+!discussion
 
-[Editor's note: For (3), we're constrained as we don't have a ">=" comparison
-operator; Before is ">". What we really want is for the parameter to represent
-the lowest priority that we will return. We could redefine "Before", but then
-we would need a different name for that function, and equivalence cases could
-have weird effects.]
+Properly implementing Dequeue_Only_High_Priority as blocking would require the use of requeue
+onto two different queues so that the calls are serviced in the order received when the
+Low_Priority is equivalent. This is pretty complex.
+
+Moreover, the majority of examples that we've seen for this routine require some sort of
+polling (a delay queue, for example, has to be polled because the time is always changing).
+Thus we simplify the definition and implementation of the language by making this routine
+return immediately along with a success or failure indication.
 
 !ACATS test
+
+No additional ACATS Tests should be needed, but the test for Dequeue_Only_High_Priority needs
+to take the new definition into account.
+
+!ASIS
+
+No effect on ASIS (this is a predefined package).
+
+!corrigendum A.18.27(0)
+
+@dinsc
+
+Force a conflict; real text found in the conflict file.
+
+!corrigendum A.18.30(0)
+
+@dinsc
+
+Force a conflict; real text found in the conflict file.
+
+!corrigendum A.18.31(0)
+
+@dinsc
 
-** TBD.
+Force a conflict; real text found in the conflict file.
 
 !appendix
 
@@ -516,7 +589,8 @@
 > but a number of other people vetted it. Bob created the AI version
 > with those changes, including the new operations, and posted in May
 > 10, 2010. There was a discussion of that draft, including by one
-> Tucker Taft. We then discussed it at the June 2010 meeting. The minutes for this AI of that meeting say:
+> Tucker Taft. We then discussed it at the June 2010 meeting. The minutes
+> for this AI of that meeting say:
 >
 >    Reword A.18.32 to say "...except that the generic formal
 > Element_Type is indefinite."

Questions? Ask the ACAA Technical Agent