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.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,38d01316d66d8f95 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.241.194 with SMTP id wk2mr10499560pbc.8.1332156542861; Mon, 19 Mar 2012 04:29:02 -0700 (PDT) Path: kz5ni5659pbc.0!nntp.google.com!news1.google.com!goblin2!goblin.stu.neva.ru!news.internetdienste.de!noris.net!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Mon, 19 Mar 2012 12:29:01 +0100 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Ada and linux real time References: <8kb66jddm0qb.1piup0wfaho1$.dlg@40tude.net> <3a01f684-b544-4051-985d-58aab98e832c@v2g2000vbx.googlegroups.com> <13z45jd9irz9x.1j2hj7ayxwkyj.dlg@40tude.net> <5777a4dc-67ef-4a35-b929-653a4d498aac@q11g2000vbu.googlegroups.com> In-Reply-To: Message-ID: <4f67187d$0$7625$9b4e6d93@newsspool1.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 19 Mar 2012 12:29:01 CET NNTP-Posting-Host: 3037213e.newsspool1.arcor-online.net X-Trace: DXC=Y6PT^NOW@=N2jYf>V4L0gLic==]BZ:afN4Fo<]lROoRA<`=YMgDjhgB@:>SDEfdW7Fnc\616M64>JLh>_cHTX3jM`_ieRCd3ClE X-Complaints-To: usenet-abuse@arcor.de Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Date: 2012-03-19T12:29:01+01:00 List-Id: On 18.03.12 23:03, slos wrote: > delay until Next_Time; > > MyDuration := To_Duration (Clock - Next_Time); I haven't looked very closely, but if, say, Next_Time has a value of 12 o'clock, then delay until Next_Time; -- (it is now 12 o'clock) My_Duration := Clock - Next_Time; will likely measure 12 o'clock - 12 o'clock, unless performing "-" takes time, or (parts of) the assignment statement is (are) put on hold by the scheduler, interrupting the task. I think that's unlike Simon's program, which subtracts a starting time, not next_time, from the current time. Minor comment on Threshold: If you assign Thresholds := (1 => MyPeriodDuration * 0.001, 2 => MyPeriodDuration * 0.005, ...); then the compiler will check that every slot gets a value. If you run the compiler with switch -gnatwa (when using GNAT), it will give a few more useful warnings.