This is the mail archive of the
mailing list for the glibc project.
Re: advise on future of glibc (mktime issue)
On Tue, 07 Jun 2005, Jairo stated: Hola:
Now, the kernel keeps track of the time and the current timezone, why
The kernel does not know the current timezone.
In any case, since you're calling mktime() so much, /etc/localtime will
be in cache: so you're comparing the cost of a kernel ring transition
and file lookup with the hypothetical cost of a kernel ring transition
and timezone lookup. Even given the open()/close() overhead, I can't
believe you'd gain that much.
Possibly an improvement is to track the time_t at which the timezone was
last checked, and throttle the rate of rechecks to one per minute or
something like that. I don't think millions of checks per second are of
any real use to anyone.
Am I missing something? If not, I'll whip up a patch that does that
(against HEAD, as this is unlikely to be suitable for the stable branch:
I can roll one against 2.3.5 anyway, if Jairo wants).
I believe I read somewhere in the kernel that the kernel knows the
difference in seconds from GMT. I have to search for it, but I think I
saw this on the kernel time tracking sections.
Your proposed solution sounds like a very good compromise. If you
roll it against 2.3.5 I can try it and send you the results.