According to our talking on IRC. I dropped locale specific procedure setlocale in my code. I choose (web http) write-date instead. And my conclusion is to avoid locale specific things in multi-thread context. Writing a new procedure for the same issue is a better solution.
Regards. On Sat, Mar 24, 2012 at 6:24 PM, Mark H Weaver <m...@netris.org> wrote: > Nala Ginrut <nalagin...@gmail.com> writes: > > Will it be a proper solution if I use "monitor"? > > No, that wouldn't work. For one thing, what if the body of > 'with-locale' takes a long time? Also, consider this: > > Thread 1: (with-locale "foo" (strftime ...)) > Thread 2: (format ...) > > If the 'format' and the 'strftime' happen simultaneously, then 'format' > will use the "foo" locale, which is incorrect. > > During 'with-locale', we would have to prevent other threads from doing > _any_ locale-dependent operation. In a system like Guile, where a > process may contain arbitrary C code and shared libraries, there's no > sane way for us to do this. In any case, it would not scale well. > > Regards, > Mark >