comp.lang.ada
 help / color / mirror / Atom feed
From: Ted Dennison <dennison@telepath.com>
Subject: Re: Using "delay until" in real-time
Date: Tue, 12 Dec 2000 19:57:32 GMT
Date: 2000-12-12T19:57:32+00:00	[thread overview]
Message-ID: <915vv7$vfo$1@nnrp1.deja.com> (raw)
In-Reply-To: 915p5n$p2j$1@nnrp1.deja.com

In article <915p5n$p2j$1@nnrp1.deja.com>,
  Mike Silva <mjsilva@my-deja.com> wrote:
> It's Son of Patriot bug...

That's similar to what I called it. :-)

> I'm as far from an expert as you can get, but what if you defined your
> Iteration in terms of Tick (4*Tick in your case)?  Seems like that
> should provide an exact representation (why do I feel like that
> comment will get me nailed?). Otherwise, keep your own Iteration
> count in a scalar and add it (first converted to a Time_Span) to a
> Start_time for each delay until.

I'm still feeling too dumb for not seeing this before to "nail" anyone
about it. Since Iteration_Hz in my old example was 4*tick, it sounds
like you are saying something like:

   task Executive is
      Iteration_Count : Natural := 0;
      Start_Time      : Ada.Real_Time.Time := Ada.Real_Time.Clock;
   begin
      loop
         -- do work
         Iteration_Count := Iteration_Count + 1;
         delay until Start_Time + (Iteration_Count * Iteration_Hz);
      end loop;
   end Executive;

I see a couple of problems with this.
   o  This would only work for Natural'last iterations. That could be
accounted for though.
   o  Iteration_Count * Iteration_Hz is no different mathematicly from
adding Iteration_Hz to Start_Time Iteration_Count times, which is what I
was doing. You'd still get the same compounding round-off error.

> It's a very interesting question, and if I'm wrong I look forward to
> learning the right answer.

Very. I had a lot of enthusiasticly offered ideas here at work when I
asked about it yesterday.

--
T.E.D.

http://www.telepath.com/~dennison/Ted/TED.html


Sent via Deja.com
http://www.deja.com/



  reply	other threads:[~2000-12-12 19:57 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-12-12 16:27 Using "delay until" in real-time Ted Dennison
2000-12-12 18:01 ` Mike Silva
2000-12-12 19:57   ` Ted Dennison [this message]
2000-12-12 23:02     ` Mike Silva
2000-12-12 23:49       ` Ted Dennison
2000-12-18  6:26     ` Ray Blaak
2000-12-12 20:00 ` Ken Garlington
2000-12-12 20:40   ` Ted Dennison
2000-12-13  4:02     ` Ken Garlington
2000-12-13 14:29       ` Ted Dennison
2000-12-13 16:53     ` Larry Hazel
2000-12-13 17:41       ` Ted Dennison
2000-12-12 20:22 ` Keith Thompson
2000-12-12 20:54   ` Ted Dennison
2000-12-13  5:35   ` tmoran
2000-12-12 20:23 ` David C. Hoos, Sr.
2000-12-12 21:58   ` Ted Dennison
2000-12-12 23:18   ` Jeff Carter
2000-12-12 21:18 ` JP Thornley
2000-12-12 22:31   ` Ted Dennison
2000-12-13  8:02     ` Brian Orpin
2000-12-13 17:32     ` JP Thornley
2000-12-12 23:09 ` Ted Dennison
2000-12-13  7:43 ` Brian Orpin
2000-12-15  0:27 ` Frank
2000-12-19  7:50 ` Martin Gangkofer
2000-12-20  3:32   ` Ted Dennison
2000-12-20  5:29     ` tmoran
2000-12-20  7:59     ` Martin Gangkofer
2000-12-20  9:15       ` java servlets JF Harrison
2000-12-20 12:50     ` Using "delay until" in real-time Marin David Condic
2000-12-21  0:08     ` Alejandro R. Mosteo
2000-12-20  3:17 ` Ted Dennison
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox