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 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!l53g2000cwa.googlegroups.com!not-for-mail From: "Adam Beneschan" Newsgroups: comp.lang.ada Subject: Re: real_time.clock is not monotonic Date: 21 Feb 2007 18:05:53 -0800 Organization: http://groups.google.com Message-ID: <1172109952.949446.215540@l53g2000cwa.googlegroups.com> References: <1172074608.834181.198540@j27g2000cwj.googlegroups.com> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1172109959 3550 127.0.0.1 (22 Feb 2007 02:05:59 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 22 Feb 2007 02:05:59 +0000 (UTC) In-Reply-To: <1172074608.834181.198540@j27g2000cwj.googlegroups.com> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: l53g2000cwa.googlegroups.com; posting-host=66.126.103.122; posting-account=cw1zeQwAAABOY2vF_g6V_9cdsyY_wV9w Xref: g2news2.google.com comp.lang.ada:9389 Date: 2007-02-21T18:05:53-08:00 List-Id: 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