From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,cae92f92d6a1d4b1 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Ada.Execution_Time Date: Fri, 17 Dec 2010 13:50:26 +0200 Organization: Tidorum Ltd Message-ID: <8n1142Fto2U1@mid.individual.net> References: <4d05e737$0$6980$9b4e6d93@newsspool4.arcor-online.net> <1wmsukf0wglz3$.odnzonrpayly.dlg@40tude.net> <6n1c5myuf2uz$.10jl3ln7il3aq.dlg@40tude.net> <8n0mgnFv2sU1@mid.individual.net> <1n3o55xjdjr9t.1u33kb75y2jfl$.dlg@40tude.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net bwp1qQP11I/4Y0sVXwSVcALjeoiZhal2ccC1Bh6nG5eJNFKkIU Cancel-Lock: sha1:hlbuofJeEcsWLL5tx8aHrHLxTx8= User-Agent: Mozilla-Thunderbird 2.0.0.24 (X11/20100328) In-Reply-To: <1n3o55xjdjr9t.1u33kb75y2jfl$.dlg@40tude.net> Xref: g2news2.google.com comp.lang.ada:16979 Date: 2010-12-17T13:50:26+02:00 List-Id: Dmitry A. Kazakov wrote: > On Fri, 17 Dec 2010 10:49:26 +0200, Niklas Holsti wrote: > >> Dmitry A. Kazakov wrote: >>> CPU_Time has no physical meaning. 2s might be 2.5s >>> real time or 1 year real time. >> CPU_Time values have physical meaning after being summed over all tasks. >> The sum should be the real time, as closely as possible. > > 1. Not tasks, but threads + kernel services + kernel drivers + CPU > frequency slowdowns => a) wrong; b) out of Ada scope => cannot be mandated I believe we are talking about the intended meaning of Ada.Execution_Time.CPU_Time, not about how far it can be precisely "mandated" (standardized). Appendix D is about real-time systems, and I believe it is aimed in particular at systems built with Ada tasks and the Ada RTS. In such systems there may or may not be CPU time -- "overhead" -- that is not included in the CPU_Time of any task. See the last sentence in RM D.14 11/2: "It is implementation defined which task, if any, is charged the execution time that is consumed by interrupt handlers and run-time services on behalf of the system". In most systems there will be some such non-task overhead, but in a "pure Ada" system it should be small relative to the total CPU_Time of the tasks. By "CPU frequency slowdowns" I assume you mean a system that varies the CPU clock frequency, for example to reduce energy consumption when load is low. This do not necessarily conflict with Ada.Execution_Time and the physical meaning of CPU_Time, although it may make implementation harder. One implementation could be to drive the CPU-time counter by a fixed clock (a timer clock), not by the CPU clock. > 2. Not so anyway under many OSes => again, cannot be mandated Whether or not all OSes support the concepts of Ada.Execution_Time is irrelevant to a discussion of the intended meaning of CPU_Time. > 3. The intended purpose of CPU_Time has nothing to do with this constraint. > Nobody is interested in knowing if the actual sum is close or not to the > real time duration. Real-time task scheduling and schedulability analysis is *all* about adding up task execution times (CPU_Time values, in principle) and comparing the sums to real-time deadlines (durations). I do believe there are some people, here and there, who are interested in such things... In practice, since tasks in real-time Ada systems are usually created once at system start and are thereafter repeatedly activated (triggered) for each job (each deadline), the total CPU_Time of a task is less relevant for scheduling decisions than is the increase in CPU_Time since the last activation of the task. Using the services of Ada.Execution_Time, that increment is represented as a Time_Span. From this point of view, it is understandable that Ada.Execution_Time does not provide an addition operation "+" (Left, Right : CPU_Time) return CPU_Time. > It is a simulation time, which *could* be projected to > the real time in order to estimate potential CPU load. "Simulation", "projection"... convey no meaning to me. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .