comp.lang.ada
 help / color / mirror / Atom feed
From: frederic.ormancey@atosorigin.com
Subject: real_time.clock is not monotonic
Date: 21 Feb 2007 08:16:48 -0800
Date: 2007-02-21T08:16:48-08:00	[thread overview]
Message-ID: <1172074608.834181.198540@j27g2000cwj.googlegroups.com> (raw)

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

This bug was detected with 3.15p Linux version, but implementation is
still the same with latest source of gnat runtime (s-osprim.adb).

Did someone have a solution for this problem ? another implementation
using a Linux monotonic clock ?




             reply	other threads:[~2007-02-21 16:16 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-21 16:16 frederic.ormancey [this message]
2007-02-21 19:46 ` real_time.clock is not monotonic 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
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