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, REPLYTO_WITHOUT_TO_CC autolearn=no 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!news4.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!193.201.147.78.MISMATCH!feeder.news-service.com!news.netcologne.de!newsfeed-fusi2.netcologne.de!newsfeed.straub-nv.de!uucp.gnuu.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Ada.Execution_Time Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH 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> <8n1142Fto2U1@mid.individual.net> <1o5cbm4b1l20d$.19winbma6k5qw.dlg@40tude.net> <8n4mskF7mmU1@mid.individual.net> <8nm30fF7r9U1@mid.individual.net> <1akm5muxu9zni.mu91b7pubqw0$.dlg@40tude.net> <8nrg25FoucU1@mid.individual.net> <2k07hwmh6123.1pgx57welw9of$.dlg@40tude.net> <8nsa76Fj4rU1@mid.individual.net> <1j9i6trxinqtg$.renlw9wdtpsf.dlg@40tude.net> <8nubhsF6e8U1@mid.individual.net> Date: Tue, 28 Dec 2010 16:42:29 +0100 Message-ID: <9ulzg911gy1q.hztezq0qtfee$.dlg@40tude.net> NNTP-Posting-Date: 28 Dec 2010 16:42:30 CET NNTP-Posting-Host: e45c02c9.newsspool2.arcor-online.net X-Trace: DXC=S0P=E1h3HaQU6b:FjPaGjQA9EHlD;3YcR4Fo<]lROoRQ8kF6UP X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:17168 Date: 2010-12-28T16:42:30+01:00 List-Id: On Tue, 28 Dec 2010 16:46:20 +0200, Niklas Holsti wrote: > And you seem to forget that Ada.Execution_Time may be implemented by > reading a real-time clock. As has been said before. Only if you have control over the OS or else can hook on task switches. I think it is doable under VxWorks. But I doubt that AdaCore would do this. > Dmitry: >>>> I don't >>>> care how much processor time my control loop takes so long it manages to >>>> write the outputs when the actuators expect them. > Niklas: >>> You should care, if the processor must also have time for some other >>> tasks of lower priority, which are preempted by the control-loop task. > Dmitry: >> Why? It is straightforward: the task of higher priority level owns the >> processor. > > Do you mean that your system has only one task with real-time deadlines, > and no CPU time has to be left for lower-priority tasks, and no CPU time > is taken by higher-priority tasks? Then scheduling is trivial for your > system and your system is a poor example for a discussion about scheduling. Right, a real-time system is usually a bunch of tasks activated according to their priority levels. This is why I doubted that Ada.Execution_Time might be useful there. > Niklas: >>> For example, assume that the computation in a control algorithm consists >>> of two consecutive stages where the first stage processes the inputs >>> into a state model and the second stage computes the control outputs >>> from the state model. Using Ada.Execution_Time or >>> Ada.Execution_Time.Timers the program could detect an unexpectedly high >>> CPU usage in the first stage, and fall back to a simpler, faster >>> algorithm in the second stage, to ensure that some control outputs are >>> computed before the deadline. > Dmitry: >> No, in our systems we use a different schema. > > So what? I said nothing (and know nothing) about your system, any > resemblance is coincidental. And there can be several valid schemas. No, the point was rather that your schema is not typical for a real-time system. >> Consider a system with n-processors. The execution >> time second will be 1/n of the real time second. > > No. If you have n workers digging a ditch, you must pay each of them the > same amount of money each hour as if you had one worker. So the "digging > hour" is still one hour, although the total amount of work that can be > done in one hour is n digging-hours. You are confusing the total amount > of work with the amount of work per worker. The ditch has 10 digging hours, this is a virtual time, which can be 1 real hour if I had 10 workers or 26 hours if I have only one (26 = 24(8) + 2, 8 hours per day). With one worker it can even be 26 + 48 if he starts Friday, or even more if she takes a leave for child rearing (:-)). The sum of working hours is a measure of work. It is not a measure of time. Time = Work / Power You can use it to estimate the real time required to complete the work ... or just re-read the The Mythical Man-Month... (:-)) > With n processors the system can do n seconds worth of execution in one > real-time second. But each processor still executes for one second. And > as I understand the Ada task dispatching/scheduling model, one task > cannot execute at the same time on more than one processor, so one task > cannot accumulate more than one second of execution time in one second > of real time. Yes. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de