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,61d8daec8bfa486e X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder3.cambriumusenet.nl!feed.tweaknews.nl!193.201.147.80.MISMATCH!news.astraweb.com!border3.a.newsrouter.astraweb.com!newsfeed.kpn.net!pfeed09.wxs.nl!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: An Example for Ada.Execution_Time Date: Fri, 31 Dec 2010 13:05:06 +0000 Organization: A noiseless patient Spider Message-ID: References: <1fb06tjt2dy1y$.1tkafcv9oya2w.dlg@40tude.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx03.eternal-september.org; posting-host="dFCm8HWntFqmDIilBLqEJQ"; logging-data="5589"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18zdYtuKM/ERtXIC4hDxkYQ3+7m6PlludY=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (darwin) Cancel-Lock: sha1:qA5QCvktW0pxH++j/hlgdSf6v4A= sha1:tSODlkiAy0zPSP1iXOhf42gpn44= Xref: g2news2.google.com comp.lang.ada:17253 Date: 2010-12-31T13:05:06+00:00 List-Id: "Dmitry A. Kazakov" writes: > On Thu, 30 Dec 2010 18:51:30 -0500, BrianG wrote: > >> Since D.16 defines CPU_Time as if it were a numeric value, is it too >> much to ask why a conversion to some form of numeric value wasn't >> provided? > > But time is not a number and was not defined as if it were. It is the time > differences which are numeric. RM D.14 defines differences of CPU_Time as > Time_Span. Time_Span is numeric. This is certainly true. However, I remain surprised that .. even delving back to v1.2 of the AI .. the proposer found it necessary to have this type CPU_Time. The concept being looked for is the number of seconds during which *this* task was executing, still sounds like a Duration (OK, Time_Span if you must) to me. > I think this is the core of misunderstanding. The thing you have in > mind is "time interval since the task start according to the execution > time clock." It is not Ada.Execution_Time.Clock, it is: > > Ada.Execution_Time.Clock - CPU_Time_First I don't _think_ that CPU_Time_First is actually defined as the value of Clock when the task starts (is initialized, put on the ready queue, whatever). D14(13/2) says "For each task, the execution time value is set to zero at the creation of the task."; however, zero is clearly not a value of CPU_Time, so I don't know what is meant. > There is a direct correspondence between two, yet they are > conceptually different things. I have no idea what's meant by CPU_Time, then! Seems to me it's a giant bug waiting to happen. It's clear that the CPU_Time of one task is incommensurate with the CPU_Time of another. Given that, what's it _for_? Of course, I competely understand that the Standard is what it is, and no one's going to change it at this point.