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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ff7d8060c8210f40,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!j27g2000cwj.googlegroups.com!not-for-mail From: frederic.ormancey@atosorigin.com Newsgroups: comp.lang.ada Subject: real_time.clock is not monotonic Date: 21 Feb 2007 08:16:48 -0800 Organization: http://groups.google.com Message-ID: <1172074608.834181.198540@j27g2000cwj.googlegroups.com> NNTP-Posting-Host: 80.78.0.137 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1172074614 15399 127.0.0.1 (21 Feb 2007 16:16:54 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 21 Feb 2007 16:16:54 +0000 (UTC) User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.0; fr-FR; rv:1.7.10) Gecko/20050717 Firefox/1.0.6,gzip(gfe),gzip(gfe) X-HTTP-Via: 1.1 proxy-mdp.labege.si.fr.atosorigin.com:3128 (squid/2.5.STABLE14), 1.0 proxy3.si.fr.atosorigin.com:1318 (Squid/2.4.STABLE6) Complaints-To: groups-abuse@google.com Injection-Info: j27g2000cwj.googlegroups.com; posting-host=80.78.0.137; posting-account=epkUgQwAAADq8mbygH9gny_DjK_gnUZu Xref: g2news2.google.com comp.lang.ada:9374 Date: 2007-02-21T08:16:48-08:00 List-Id: 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 ?