|
Boost : |
From: Jeff Garland (jeff_at_[hidden])
Date: 2005-03-08 08:20:32
On Tue, 8 Mar 2005 14:48:00 +0200, Peter Dimov wrote
> > That's true -- date_time doesn't do anything to ensure thread safety.
> > I'm a little reluctant to protect these functions since the user can
> > determine better if they need to take the associated performance hit.
> > Of course this needs to be documented, which it isn't now. Thoughts?
>
> There is no performance hit associated with the _r functions, and
> the user is not necessarily in a position to insert locks around
> localtime calls, because he might be using date_time indirectly. In
> my opinion, every library must provide the basic thread-safety
> guarantee in its default configuration.
Well I don't think just calling the _r function is enough to ensure the thread
safety of this code. I believe I would have to insert a lock in the date-time
code to make this assurance.
Jeff
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk