comp.lang.ada
 help / color / mirror / Atom feed
From: Ted Dennison <dennison@telepath.com>
Subject: Re: Duration vs. Ada.Real_Time
Date: Wed, 31 Jan 2001 20:53:26 GMT
Date: 2001-01-31T20:53:26+00:00	[thread overview]
Message-ID: <959u02$1o0$1@nnrp1.deja.com> (raw)
In-Reply-To: 3A786497.1C791722@acm.org

In article <3A786497.1C791722@acm.org>,
  Marin David Condic <mcondic.auntie.spam@acm.org> wrote:

> In your example you have three possible time sources. Which would you
> pick for dealing with Duration? Which would you pick for
> Ada.Real_Time.Time_Span?

For a PC, if I were making TEDAda, I'd probably want to match duration
with the units the OS uses for its time of day primitives (which are
possibly based on source 2) or the Ada minimum requirements, whichever
is higher-res. For Ada.Real_Time.Time, It'd be nice to use units of
ticks on the high-frequency clock (time source 3), as that will give me
the most possible resolution (which is critical for being able to
accurately measure elapsed time for small tasks). For
Ada.Real_Time.Time_Span, it would probably be best to use the same
units, as  I'd want to be able to use Real_Time.Time_Span in
calculations with Real_Time.Time without loosing accuracy. That means
any use of "delay" or "delay until" is going require a conversion from
one of those other time sources into the OS's units for its thread timed
rescueduling primitives (perhaps based on source 1). However, that is
often in RTC "ticks", so a conversion would have been nessecary anyway.

I know our Ada vendor (GreenHills) chose to use microseconds as its
units for Ada.Real_Time.Time. I believe they made that decision because
support for the high-res timer is a kernel-configurable item (not always
available), and because they use the same compiler codebase on multiple
architectures under the same OS. So it was a good decision for them. But
it has the unfortunate effect that any use of the high-res timer has to
be done via direct OS calls.


> I'm not saying all Ada compilers everywhere should do this for every
> target - just where it makes some sense because of what the hardware
> or OS provides you. It might be possible to make it user configurable

Is there some RTC hardware out there that uses seconds instead of Hz as
its units? If so, and if its OS rescheduling primitive kept the same
units, then yes, the Ada vendor for that platform should also use those
same units.

--
T.E.D.

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


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



  reply	other threads:[~2001-01-31 20:53 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <980495512.529981@edh3>
     [not found] ` <8mac6.9236$R5.473526@news1.frmt1.sfba.home.com>
2001-01-26 15:30   ` Duration vs. Ada.Real_Time Robert Dewar
     [not found] ` <3A71814B.7E8CCF60@acm.org>
2001-01-26 15:33   ` Robert Dewar
2001-01-26 20:58     ` Marin David Condic
2001-01-26 21:32       ` Ted Dennison
2001-01-27  5:01         ` Keith Thompson
2001-01-27 14:40           ` Marin David Condic
2001-01-27 14:34         ` Marin David Condic
2001-01-28  0:18           ` Robert Dewar
2001-01-29 14:54           ` Ted Dennison
2001-01-29 18:40             ` Marin David Condic
2001-02-08  3:32               ` Buz Cory
2001-02-08 15:34                 ` Marin David Condic
2001-02-10  3:08                   ` Steve Whalen
2001-01-28  0:13       ` Robert Dewar
2001-01-29 14:02         ` Marin David Condic
2001-01-30 14:33         ` Stephen Leake
2001-01-31 14:55           ` Marin David Condic
2001-01-31 16:03           ` Ted Dennison
2001-01-31 19:16             ` Marin David Condic
2001-01-31 20:53               ` Ted Dennison [this message]
2001-01-31 21:30                 ` tmoran
2001-01-31 21:47                 ` Marin David Condic
2001-02-01 14:18                   ` Ted Dennison
2001-01-28 19:32 ` Simon Wright
2001-01-31  6:13   ` Robert Dewar
2001-01-31 15:07     ` Marin David Condic
2001-02-01  5:43       ` Robert Dewar
2001-01-31  5:51 Christoph Grein
2001-02-01  6:27 ` Simon Wright
replies disabled

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