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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,8c564a80b820db35 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.134.225 with SMTP id pn1mr4126961pbb.7.1331023698993; Tue, 06 Mar 2012 00:48:18 -0800 (PST) Path: h9ni45216pbe.0!nntp.google.com!news1.google.com!goblin3!goblin.stu.neva.ru!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Any leap year issues caused by Ada yesterday? Date: Tue, 6 Mar 2012 09:47:45 +0100 Organization: cbb software GmbH Message-ID: <18ghv3yeh1a1k$.1bjwdaps59rt3$.dlg@40tude.net> References: <4f4f746a$0$6565$9b4e6d93@newsspool3.arcor-online.net> <20608866.730.1330963171058.JavaMail.geo-discussion-forums@ynbq18> <1t8v4akrmapkl.1xwfi9yxtw2ji$.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2012-03-06T09:47:45+01:00 List-Id: On Mon, 05 Mar 2012 20:56:09 +0000, Simon Wright wrote: > "Dmitry A. Kazakov" writes: > >> On Mon, 05 Mar 2012 18:30:46 +0000, Simon Wright wrote: >> >>> "Dmitry A. Kazakov" writes: >>> >>>> BTW, I would not wonder to see Real_Time.Time and Calendar.Time same >>>> or correlated. >>> >>> We were surprised and disappointed to find that earlier releases of GNAT >>> did have them the same. What happens to your precise timing if you get >>> an NTP update in the middle of it? >> >> Nothing, because I would expect the NTP client to leave alone the clock >> readings and the arithmetic of. It should rather adjust Split and Time_Of. > > Some people would arrange time sync such that if: > > a) you read the clock > b) time sync sets the clock back 1 second > c) after 1 second you read the clock again > > that the time read at a) and c) would be the same. > >> In our setups we are using a different schema anyway. Instead of >> adjusting clocks we do the time stamps when sending them from host to >> host. > > Because of the GNAT bug we couldn't use Ada.Real_Time. So we left > Ada.Calendar untouched and made our own .Calendar with offsets, > as you say. Fun with I/O of time, > >>> OK, this is slightly GNAT-related, since (at that time, anyway) "delay >>> 0.5" translated under the hood into "delay until now + 0.5" on VxWorks, >> >> Yes, but NTP should not mingle in that. [I don't know how the VxWorks NTP >> client works.] > > I don't understand? What else would it do but change the value of > Ada.Calendar.Clock? It would be difficult to do. The most straightforward and efficient implementation of Time is a 64-bit number (N) taken directly from the corresponding machine register, e.g. the performance counter. Why would you change it (provided any machine support for doing that existed)? You would rather leave it as is and adjust the epoch instead (and, unlikely, the multiplier) when calculating the calendar time: Epoch time + N * Multiplier This is needed only in operations dealing with year, month etc, e.g. Split. Granted there could issues with delay until , but this is negligibly comparing to the problems when the performance counter were indeed adjusted. >>> so you were always related to the actual clock. >> >> VxWorks clock on i7 is a garbage. It is driven by the timer interrupts, >> i.e. to get 1ms resolution you need 1000 interrupts per second. >> >> We keep on asking Wind River to fix the mess, but without much success so >> far. GNAT simply uses that clock. So delay 0.001 may mean absolutely >> anything under VxWorks. To fix that one should rewrite the time driver. > > We were quite happy with 1 ms ticks. So delay 0.001 meant "delay at > least 1 and no more than 2 ms" (like always). If you set the timer at 1ms rate, you would have 1ms delays. The problem is that the time stamps would have only 1ms accuracy! For 10kHz measurements and control we are doing, this is a bit dire. So we are setting the timer interrupts at 0.01ms (which is our humble contribution to the "man-made" climate change (:-)) >>> AdaCore accepted the bug report (after we pointed out the "shall" in >>> ARM95 D.8(32)). >> >> Well, I would not blame AdaCore for that, it is Wind River's fault, >> IMO. > > This was *Ada* running on VxWorks; so it needed fixing. We didn't care > who fixed it (well, as far as we were concerned, who didn't fix it, > actually). Yes, but AdaCore has neither the resources nor desire to patch crappy OSes. They will have enough to do fixing the problems introduced with the implementation of Ada 2012... -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de