in reply to Re: Standard way to convert timezone in multithreaded script
in thread Standard way to convert timezone in multithreaded script
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Standard way to convert timezone in multithreaded script
by whale2 (Novice) on Nov 25, 2009 at 07:36 UTC | |
by BrowserUk (Patriarch) on Nov 25, 2009 at 08:41 UTC | |
by whale2 (Novice) on Nov 25, 2009 at 09:42 UTC | |
by whale2 (Novice) on Nov 25, 2009 at 11:00 UTC | |
by BrowserUk (Patriarch) on Nov 25, 2009 at 11:29 UTC | |
by whale2 (Novice) on Nov 25, 2009 at 15:03 UTC | |
by ikegami (Patriarch) on Nov 25, 2009 at 18:48 UTC |