zonefile changes and long running processes.

Paul Eggert eggert@cs.ucla.edu
Wed May 14 14:11:00 GMT 2014


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.



More information about the Libc-alpha mailing list