guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Request] How about adding with-locale?


From: Nala Ginrut
Subject: Re: [Request] How about adding with-locale?
Date: Sat, 24 Mar 2012 20:42:48 +0800

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 <address@hidden> wrote:
Nala Ginrut <address@hidden> 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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]