[Vm-dev] microsecond timing for GC work

David T. Lewis lewis at mail.msen.com
Wed Jan 20 01:13:57 UTC 2010


On Tue, Jan 19, 2010 at 04:28:47PM -0800, Andreas Raab wrote:
> >
> >Would anyone object to the addition of a primitive that answers
> >Posix seconds (to some reasonable precision) plus time zone offset?
> >This would be a named primitive in addition to John's microsecond
> >primitive.
> 
> I'm not sure what the point of it would be. Both of you are speaking in 
> riddles at this point; it would be good if you could spell out the 
> issues more clearly.

The clock in Squeak is done in local time (UTC translated to local
seconds in the VM before it is reported to the image). Consider a
Squeak image running in a locale with daylight savings time. Once
per year in the fall, there is a period of one hour during which the
Squeak clock has "jumped backwards" one hour. All of the values of the
Squeak clock are repeated during for the next hour. The values are
ambiguous, and the calculation of durations and times based on them
is problematic.

Time and duration manipulation is much simpler if you use a monotonically
increasing clock and calculate local times based on UTC and the local
offset value. The earliest Smalltalk systems were probably single
user systems for which time zones and duration calculations would
have been of little concern, but in an era when Squeak is used for
server applications and shared images in different parts of the world,
it is better to get this stuff right.

Dave



More information about the Vm-dev mailing list