This is the mail archive of the
mailing list for the glibc project.
Re: zonefile changes and long running processes.
- From: Paul Eggert <eggert at cs dot ucla dot edu>
- To: OndÅej BÃlka <neleai at seznam dot cz>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Wed, 14 May 2014 07:03:21 -0700
- Subject: Re: zonefile changes and long running processes.
- Authentication-results: sourceware.org; auth=none
- References: <53633D96 dot 6070306 at redhat dot com> <5363DD40 dot 2040408 at cs dot ucla dot edu> <53642A07 dot 1040107 at redhat dot com> <53648418 dot 6000301 at cs dot ucla dot edu> <536AE8E0 dot 8090907 at redhat dot com> <536B16A3 dot 1010403 at cs dot ucla dot edu> <20140513211452 dot GD15468 at domone dot podge> <5372918B dot 2090407 at cs dot ucla dot edu> <20140513223354 dot GA17555 at domone dot podge> <5372C55A dot 70800 at cs dot ucla dot edu> <20140514081757 dot GA19066 at domone dot podge>
OndÅej BÃlka wrote:
As we do not free a timezone string we could do same, construct
immutable structure with precomputed data that and look if there is
already such structure. It would take only one read for localtime_r
which is fast enough.
That's more like it. But we can do even better: localtime_r can simply
look at the structure and use it, without testing whether there is
already such a structure. That would avoid an unnecessary branch. If
the initial version of the precomputed structure (all zeros, say?) is
valid, and if localtime_r can't dump core merely because the structure
is being updated by some other thread's call to tzset, this would
conform to POSIX.