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=-0.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,cae92f92d6a1d4b1 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder.news-service.com!news-out2.kabelfoon.nl!newsfeed.kabelfoon.nl!xindi.nntp.kabelfoon.nl!news.ett.com.ua!not-for-mail From: anon@att.net Newsgroups: comp.lang.ada Subject: Re: Ada.Execution_Time Date: Fri, 17 Dec 2010 08:59:12 +0000 (UTC) Organization: ETT newsserver Message-ID: References: <4d05e737$0$6980$9b4e6d93@newsspool4.arcor-online.net> Reply-To: anon@anon.org NNTP-Posting-Host: dialup-4.225.168.223.dial1.dallas1.level3.net X-Complaints-To: usenet@news.ett.com.ua X-Notice: Filtered by postfilter v. 0.6.1 X-Newsreader: IBM NewsReader/2 2.0 Xref: g2news2.google.com comp.lang.ada:16976 Date: 2010-12-17T08:59:12+00:00 List-Id: In , BrianG writes: >Georg Bauhaus wrote: >> On 12/12/10 10:59 PM, BrianG wrote: >> >> >>> But my question still remains: What's the intended use of >>> Ada.Execution_Time? Is there an intended use where its content >>> (CPU_Time, Seconds_Count and Time_Span, "+", "<", etc.) is useful? >> >> I think that your original posting mentions a use that is quite >> consistent with what the rationale says: each task has its own time. >> Points in time objects can be split into values suitable for >> arithmetic, using Time_Span objects. Then, from the result of >> arithmetic, produce an object suitable for print, as desired. >> >> >> While this seems like having to write a bit much, >> it makes things explicit, like Ada forces one to be >> in many cases. That' how I explain the series of >> steps to myself. >> >> Isn't it just like "null;" being required to express >> the null statement? It seems to me to be a logical >> consequence of requiring that intents must be stated >> explicitly. >> >I have no problem with verbosity or explicitness, and that's not what I >was asking about. > >My problem is that what is provided in the package in question does not >provide any "values suitable for arithmetic" or provide "an object >suitable for print" (unless all you care about is the number of whole >seconds with no information about the (required) fraction, which seems >rather limiting). Time_Span is a private type, defined in another >package. If all I want is CPU_Time (in some form), why do I need >Ada.Real_Time? Also, why are "+" and "-" provided as they are defined? > (And why Time_Span? I thought that was the difference between two >times, not the fractional part of time.) > >Given the rest of this thread, I would guess my answer is "No, no one >actually uses Ada.Execution_Time". > >--BrianG Ada.Execution_Time is use for performance and reliability monitoring of the cpu resource aka a MCP (Tron). The control program can monitor the cpu usage of each task and decide which task needs to give up the CPU for the next task. With a shared server system it monitors which web site is over using the cpu and shutdown that web site temporality or permanent. One example too many Java Servlet on a web site. For Ada 2012, it will mostly like will be use in the Ada runtime to balance the load for an Ada partition on multiple cores. Aka job scheduler for multiple tasks on multiple CPUs. For the average Ada programmer, its another Ada package that most will never use because they will just use Ada.Real_Time. The only problem is that Ada.Real_Time is an accumulation of times. A small list of these times includes VS swapping, IO processing, any cpu handled interrupts, as well as times for the task to execute as well as time the task sleeps while other tasks are executing. In some cases the Ada.Execution_Time package can replace the Ada.Real_Time with only altering the with/use statements. Some programmers might use this package to try to improve performance of an algorithm. And a few might use this package for debugging like to prevent tasks from running away with the CPU resources. Such as stopping this type of logical condition from occurring at runtime: with x86 ; -- defines x86 instructions subset use x86 ; task body run is begin Disable_Interrupts ; loop -- Endless loop. null ; -- Which optimizes to one jump instruction end loop ; end run ; Which when optimize can shutdown a cpu or computer system. And requires either a non-maskable reset or a full power cold restart without being able to save critical data or closing files. Also, in history this package would be use to calculate the cpu usage charges for a customer.