P is for Practical | |
PerlMonks |
Re^2: Standard way to convert timezone in multithreaded scriptby BrowserUk (Patriarch) |
on Nov 25, 2009 at 00:55 UTC ( [id://809244]=note: print w/replies, xml ) | Need Help?? |
Nice. And thanks for sharing it. FWIW: I think the reason why POSIX::tzset() fails to work correctly in threads is because when threads are spawned, they are given their own copy of the process' environment block. But the tzset() wrapper in POSIX and the underlying CRT tzset() know nothing of those copies, hence do not honour changes made to them. It would be possible to make the POSIX tzset() wrapper recognise that it is being called within a thread and adjust the process env block to match the calling threads prior to calling the CRT, but unless the CRT also maintained a per-thread notion of the current timezone it would be messy. One day the POSIX definition will be revamped to take account of threading. Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
In Section
Seekers of Perl Wisdom
|
|