Re: Collation patch's handling of wcstombs/mbstowcs is sheerest fantasy

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Collation patch's handling of wcstombs/mbstowcs is sheerest fantasy
Дата
Msg-id 26536.1303573069@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Collation patch's handling of wcstombs/mbstowcs is sheerest fantasy  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Collation patch's handling of wcstombs/mbstowcs is sheerest fantasy  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
I wrote:
> * Where they're not, install the locale_t with uselocale(), do
> mbstowcs or wcstombs, and revert to the former locale_t setting.
> This is ugly as sin, and not thread-safe, but of course lots of
> the backend is not thread-safe.

I've been corrected on that: uselocale() *is* thread safe, at least in
glibc (it only affects the locale used by the current thread).  And it's
"only a few instructions" according to Jakub Jelinek.  So a temporary
setting via uselocale is exactly what you're supposed to do for any
locale-sensitive function that hasn't got a *_l variant.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Dimitri Fontaine
Дата:
Сообщение: Re: pgbench \for or similar loop
Следующее
От: "Kevin Grittner"
Дата:
Сообщение: Re: What Index Access Method Functions are really needed?