Re: localtime() thread-safe or not?



MarkMark wrote:

localtime() C Runtime API is documented (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_localtime.asp) to return result in static memory, which, of course is not thread safe.

However, indirect evidence (http://support.microsoft.com/default.aspx?scid=kb;en-us;104641) appears to suggest that localtime() actually uses Thread Local Store which makes it thread safe.

So my question is -- is localtime() really thread safe or not?

The entire C runtime is thread safe it you create the thread using _beginthread() or _beginthreadex().



-- Phil Frisbie, Jr. Hawk Software http://www.hawksoft.com .



Relevant Pages