in reply to Re^4: Standard way to convert timezone in multithreaded script
in thread Standard way to convert timezone in multithreaded script
XS code contains four calls to tzset()
Perl code running in main thread works pretty well without calling POSIX::tzset. I believe this is due to how tzset()/localtime() in libc works.
'man tzset' says "This function is automatically called by the other time conversion functions that depend on the time zone."
So, there is no wonder why this works in main thread. And in child threads tzset needs to be explicitly called for changing timezone, but really works only when called in XS code. I don't know why, I just managed to find this fact :)
Also, I did not tried it on other OSes or even on another linux distro or with different libc versions or versions of perl other than 5.10.0
My environment is CentOS 5.2, libc-2.5, perl-5.10.0
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Standard way to convert timezone in multithreaded script
by whale2 (Novice) on Nov 25, 2009 at 11:00 UTC | |
|
Re^6: Standard way to convert timezone in multithreaded script
by BrowserUk (Patriarch) on Nov 25, 2009 at 11:29 UTC | |
by whale2 (Novice) on Nov 25, 2009 at 15:03 UTC |