17 Dec
2006
17 Dec
'06
8:43 a.m.
Doyon, Jean-Francois wrote at 2006-12-15 08:38 -0500:
setlocale() is a python thing. It wraps a C library, and that function setups an application wide environment (A bit like an environment variable would ...) ... Which is why it's not thread safe.
If you do not have a thread aware implementation of "setlocale", then it is *VERY* dangerous to change "setlocale" inside a thread -- as changing any global data can lead to non-deterministic behaviour in a multi-threaded environment unless special precautions (locking) are taken. Apparently, you are aware of the danger. But, I have not seen how you avoid the problem in your sketched solution. -- Dieter