multithreading and timezones

Nathan Myers ncm at
Tue Oct 22 01:49:40 UTC 1996

Valery Aronov <valery at> wrote:
> How is it possible to manage current zone information in MT-safe fashion?

From: Paul Eggert <eggert at>
> Write and use a thread-safe version of the tz library.
> This requires changing the interfaces to localtime, gmtime, tzset, etc.
> (localtime_r is not enough.)  One must also make the locale a
> parameter, for strftime at least.  And I'm afraid that this will
> require going into the guts of the C library, which will make it hard
> to do portably.
> On my (long) list of things to do is to make a thread-safe version of
> the glibc version of the tz library.  Once you know you're dealing
> with that particular library, the job becomes tractable.

The non-re-entrancy, and the globalness, of the time functions has 
long bothered me.  With the C locale itself global, there's not much
to be done about that.

The (draft) standard C++ locale is not (necessarily) global, and 
supports user extensions such as time zone handling.  Now would be
a good time to start defining a standard time zone facet for the C++ 
locale, so that it can be made official at the next round, in a few 

The glibc locale functions being worked on by Ulrich Drepper are 
designed to support a re-entrant (C) interface.  We should co-ordinate
with him to get the time zone code integrated into his architecture.

Please, let's get the interface right this time.

Nathan Myers
ncm at

More information about the tz mailing list