comp.lang.ada
 help / color / mirror / Atom feed
From: "Adam Beneschan" <adam@irvine.com>
Subject: Re: real_time.clock is not monotonic
Date: 21 Feb 2007 18:05:53 -0800
Date: 2007-02-21T18:05:53-08:00	[thread overview]
Message-ID: <1172109952.949446.215540@l53g2000cwa.googlegroups.com> (raw)
In-Reply-To: <1172074608.834181.198540@j27g2000cwj.googlegroups.com>

On Feb 21, 8:16 am, frederic.orman...@atosorigin.com wrote:
> I'm porting a GNAT application from Windows to Linux platform, and the
> application use two kinds of clock data :
> - Ada.Calendar.clock to obtain machine date and time, affect by NTP
> and daylight saving
> - Ada.real_Time.Clock, which use System.Os_Primitives.Monotonic_Clock
> to obtain a monotonic clock (for delays and time events generation)
>
> With Windows version of GNAT (3.15p), all is OK, monotonic clock use
> QueryPerformanceCounter() Win32 call to obtain a monotonic behaviour,
> but in Linux implementation of Gnat RunTime, Monotonic_Clock is a
> single rename of calendar.clock, which use gettimeofday() system
> call !!!!
>
> I'll alert Gnat community with this bad implementation, as
> gettimeofday() is affected by NTP and others date adjustements. in
> LRM, Ada.Real_Time.Clock shall be monotonic => Gnat runtime is not
> compliant

Actually, I don't see in the LRM where it says "Ada.Real_Time.Clock
shall be monotonic", in such forceful language.  D.8(1) implies that
it's supposed to be.  However, D.8(36) says, "The implementation shall
document any aspects of the external environment that could interfere
with the clock behavior as defined in this clause", and a note in the
AARM says, "For example, the implementation is allowed to rely on the
time services of an underlying operating system, and this operating
system clock can implement time zones or allow the clock to be reset
by an operator. This dependence has to be documented".  Unless I'm
over-interpreting things, this last AARM note seems to imply that, in
some cases (such as the user manually changing the date or time),
Clock might *not* be monotonic.

Is my interpretation correct?  Does this mean that GNAT's
implementation is correct (if possibly undesirable to some users) as
long as it's documented?

                          -- Adam





  parent reply	other threads:[~2007-02-22  2:05 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-21 16:16 real_time.clock is not monotonic frederic.ormancey
2007-02-21 19:46 ` Georg Bauhaus
2007-02-21 20:33   ` Michael Bode
2007-02-21 20:17 ` Simon Wright
2007-02-22  9:50   ` Duncan Sands
2007-02-22 10:34     ` Simon Wright
2007-02-22 10:53       ` Duncan Sands
2007-02-22 20:48         ` Simon Wright
2007-02-26  8:50   ` Florian Weimer
2007-02-26 20:59     ` Simon Wright
2007-02-22  2:05 ` Adam Beneschan [this message]
2007-02-22  2:34   ` Randy Brukardt
2007-02-22  3:19     ` Adam Beneschan
2007-02-22 11:04     ` [OT] Broken threading (was RE: real_time.clock is not monotonic) Alex R. Mosteo
2007-02-22 11:39       ` Georg Bauhaus
2007-02-22 14:52         ` Alex R. Mosteo
2007-02-23  0:43       ` Randy Brukardt
2007-02-23 10:11         ` Alex R. Mosteo
2007-02-25  0:39           ` [OT] Broken threading Björn Persson
2007-02-26  8:50             ` Alex R. Mosteo
2007-02-27  0:13             ` Randy Brukardt
replies disabled

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