comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Inserting Calendar.Time in a database
Date: Thu, 26 Aug 2004 22:04:51 +0200
Date: 2004-08-26T22:04:51+02:00	[thread overview]
Message-ID: <2p6u06Fh8m2oU1@uni-berlin.de> (raw)
In-Reply-To: eIWdnYG0o_FlrLPcRVn-qQ@megapath.net

Randy Brukardt wrote:

> I would expect that it might be possible on some real-time kernels. For
> those, it's clear that Ada.Calendar.Time should be UTC time,

Agree

> and a child 
> package provided to get the Local_Time_Offset if that is needed. (That
> really ought to be required behavior of Calendar, but it's simply too
> incompatible - and in the worst way, at run time - to do.)
> 
> An alternative (especially in the inprecise requirements that you
> suggested in your message) is to figure the time base of Ada.Real_Time,
> then using Real_Time for most operations. Indeed, this is exactly how
> Calendar is implemented on Janus/Ada and on GNAT for Windows: the system
> time functions are used to get the time base, and QueryPerformanceCounter
> is used to get high precision time information within that time base. (Of
> course, the fact that QueryPerformanceCounter leaps forward many seconds
> on some hardware is a problem.) We rebase every 5 minutes to avoid drift
> problems from using two separate clocks; I believe GNAT is similar.

But normally it is all that required, no more! Why not to put it the
standard? If that cannot be supported on all platforms, then it could be a
separate optional package.

> In any case, the sorts of requirements that you have are simply not
> supportable within the standard.

You mean X1 := Clock; X2 := Clock; then X1 < X2? If the *optional* package
would be required to have Time at least 64-bit, would then X1 < X2 be such
a big burden? 

> (Or implementations, for that matter.) No 
> Ada vendor is going to guarantee anything about the accuracy of the time
> base (because it's completely out of their control), which is a necessary
> parameter in any sort of distributed system. Either it doesn't matter much
> (as in HTTP), or you are going to have to take steps to insure that it is
> accurate enough, and that requires going beyond anything that the standard
> could possibly give you.

Absolutely. Time synchronization should be left outside. The standard should
only require a reasonable range -200..+200 years from now, fine resolution
1..100 nano, no backward jumps, unique readings for same task.

-- 
Regards,
Dmitry A. Kazakov
www.dmitry-kazakov.de



  reply	other threads:[~2004-08-26 20:04 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-05 13:44 Inserting Calendar.Time in a database Jano
2004-08-05 15:21 ` Dmitry A. Kazakov
2004-08-05 21:19   ` Martin Dowie
2004-08-06  6:31     ` Jano
2004-08-06 11:32       ` Peter Hermann
2004-08-06 11:40         ` Duncan Sands
2004-08-08 11:10           ` Jano
2004-08-06  7:48     ` Dmitry A. Kazakov
2004-08-06  9:28       ` Martin Dowie
2004-08-06 10:44         ` Dmitry A. Kazakov
2004-08-07  9:50           ` Martin Dowie
2004-08-07 20:32             ` Dmitry A. Kazakov
2004-08-08  8:35               ` Martin Dowie
2004-08-08 11:03                 ` Simon Wright
2004-08-09  7:46                 ` Dmitry A. Kazakov
2004-08-09 17:54                   ` Nick Roberts
2004-08-10  7:33                     ` Dmitry A. Kazakov
2004-08-10  8:36                     ` John B. Matthews
2004-08-10 18:51                       ` Nick Roberts
2004-08-11  1:14                         ` John B. Matthews
2004-08-19  4:10                         ` Jano
2004-08-19  4:10                       ` Jano
2004-08-09 11:52                 ` Frank J. Lhota
2004-08-08 10:46       ` Simon Wright
2004-08-09  8:02         ` Dmitry A. Kazakov
2004-08-24 19:25       ` Randy Brukardt
2004-08-25  7:24         ` Dmitry A. Kazakov
2004-08-25  8:18           ` Martin Dowie
2004-08-25  9:25             ` Dmitry A. Kazakov
2004-08-25  9:42               ` Martin Dowie
2004-08-26  5:26               ` Simon Wright
2004-08-26  0:49           ` Randy Brukardt
2004-08-26  9:30             ` Dmitry A. Kazakov
2004-08-26 10:11               ` Martin Dowie
2004-08-26 10:58                 ` Dmitry A. Kazakov
2004-08-26 12:32                   ` Martin Dowie
2004-08-26 16:26                     ` Dmitry A. Kazakov
2004-08-26 17:23                       ` Martin Dowie
2004-08-26 18:55               ` Randy Brukardt
2004-08-26 20:04                 ` Dmitry A. Kazakov [this message]
2004-08-26  5:22           ` Simon Wright
replies disabled

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