!standard D.14.2(3-4/2) 10-10-12 AI05-0169-1/06 !standard D.14.2(21/2) !reference AI05-0171-1 !class Amendment 09-10-22 !status Amendment 2012 10-08-12 !status ARG Approved 9-0-2 10-02-26 !status work item 09-10-22 !status received 09-10-22 !priority Low !difficulty Easy !subject Defining group budgets for multiprocessor platforms !summary Group budgets are defined to be tied to a single processor. !problem Ada 2005 does not fully define how group budgets should be implemented on multiprocessor platforms. !proposal The definition of group budgets should be changed to include a processor. A task will only consume budget if it is executing on the processor defined for that budget. The use of a default processor will mean that single processor programs will be unchanged. A task will only consume the budget of a Group Budget if it is executing on the defined processor for that Group Budget. This applies to tasks assigned to specific processors, or those that are globally scheduling within a dispatching domain. Note that the proposed change depends on the definition of type CPU from AI05-0171-1. !wording Change D.14.2(3-4/2) to: with System; with System.Multiprocessors; package Ada.Execution_Time.Group_Budgets is type Group_Budget(P : System.Multiprocessors.CPU := System.Multiprocessors.CPU'First) is tagged limited private; Change the third sentence of D.14.2(21/2) to: Any execution on processor P of any member of the group of tasks results in the budget counting down, unless exhausted. !discussion Whilst a task can only execute on one processor at a time, a group of tasks may execute in parallel. This makes it difficult for an implementation to support the execution of a handler at the point the group budget goes to zero. It also makes it difficult for the programmer to construct useful multiprocessor 'execution-time servers'. Indeed the whole concept of such servers is single processor based. The workshop (IRTAW) therefore concluded that the existing definition of group budget be changed to make it explicitly a per-processor provision. Examples were discussed at the workshop that showed that a program could move tasks between processors and group budget is a way to exploit 'reserved' budgets on each processor of an allocation domain. This change constrains how implementations can implement this package on multiprocessor systems. This is potentially inconsistent with Ada 2005, as existing programs could depend on behavior that is no longer allowed (and they would fail if compiled with Ada 2012). It is unlikely that such an implementation exists (because of the monitoring problems previously noted), and if it did programs using it are already not portable. As such this is not a major concern. !example !corrigendum D.14.2(3/2) @drepl @xcode<@b System; @b Ada.Execution_Time.Group_Budgets @b> @dby @xcode<@b System; @b System.Multiprocessors; @b Ada.Execution_Time.Group_Budgets @b> !corrigendum D.14.2(4/2) @drepl @xcode< @b Group_Budget @b;> @dby @xcode< @b Group_Budget(P : System.Multiprocessors.CPU := System.Multiprocessors.CPU'First) @b;> !corrigendum D.14.2(21/2) @drepl The procedure Replenish loads the group budget GB with To as the Time_Span value. The exception Group_Budget_Error is raised if the Time_Span value To is non-positive. Any execution of any member of the group of tasks results in the budget counting down, unless exhausted. When the budget becomes exhausted (reaches Time_Span_Zero), the associated handler is executed if the handler of group budget GB is set. Nevertheless, the tasks continue to execute. @dby The procedure Replenish loads the group budget GB with To as the Time_Span value. The exception Group_Budget_Error is raised if the Time_Span value To is non-positive. Any execution on processor P of any member of the group of tasks results in the budget counting down, unless exhausted. When the budget becomes exhausted (reaches Time_Span_Zero), the associated handler is executed if the handler of group budget GB is set. Nevertheless, the tasks continue to execute. !ACATS test Add an ACATS C-Test of setting the CPU in a group budget. !appendix ****************************************************************