This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: zonefile changes and long running processes.

On Wed, May 14, 2014 at 07:03:21AM -0700, Paul Eggert wrote:
> 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.

It would be nice to have but patch will not write itself. My point was
that adding atomicity is not that expensive. A thread safety is
requirement but its often better to crash than return date 2.3.1972 as
date which could theoretically happen if variables would be modified

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]