|
Boost : |
From: Darryl Green (green_at_[hidden])
Date: 2002-04-14 20:08:03
I've raised this issue before in the context of time types that need to be
supported by the generic time library. It is probably a trivial addition to
GTL. Boost threads would then need to be able to use it, which isn't so
trivial. This would require that the platform support something similar to
the Posix CLOCK_REALTIME (absolute UTC time) and CLOCK_MONOTONIC (not
impacted by making changes to the system time) and allow either clock to be
used. I don't think the CLOCK_MONOTONIC epoch is really specified - but
would typically be a measure of system uptime. Most systems would have such
a thing burried somewhere - though some have awfully short duration before
wrap-around occurs.
> -----Original Message-----
> From: Jeff Garland [mailto:jeff_at_[hidden]]
> Sent: Sunday, 14 April 2002 9:55 AM
> To: boost_at_[hidden]
> Subject: RE: [boost] Possible problem with xtime?
>
>
> > It seems to me that the present implementation of xtime on
> many platforms
> > relies upon the system's current time - this could change
> at any point! The
> > system time may be set backwards by the user or forwards by
> daylight saving'
> > s time, both which may result in code using xtime to
> receive incorrect time
> > durations.
> >
> > Consider the following...
> >
> > boost::xtime xt;
> > boost::xtime_get(&xt, boost::TIME_UTC);
>
> The TIME_UTC is not subject to DST. Although it still
> depends on the timezone settings of the
> computer staying constant between calls. This is usually a
> reasonable assumption.
>
> > Would it not make more sense to always base durations in
> time upon something
> > which is always moving forward in time at a consistent
> rate, such as the
> > system uptime?
>
> Possibly for the case of thread management this would make
> sense. The question is how to make it
> portable. The current xtime implementation relies on the C
> API for portability...
>
> Jeff
>
> _______________________________________________
> Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk