Re: Thread-safe nl_langinfo() and localeconv()

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Thread-safe nl_langinfo() and localeconv()
Date: 2024-08-19 06:29:06
Message-ID: CA+hUKGLYkqXkRDpEsZWE6-=ZA-o3MMz=aYZ0cA2Gi-i=2EtjcQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Here is a slightly better version of patch 0003. I removed some
unnecessary refactoring, making the patch smaller.

FTR I wrote a small program[1] for CI to test the assumptions about
Windows in 0001. I printed out the addresses of the objects, to
confirm that different threads were looking at different objects once
the thread local mode was activated, and also assert that the struct
contents were as expected while 8 threads switched locales in a tight
loop, and the output[2] looked OK to me.

[1] https://github.com/macdice/hello-windows/blob/793eb2fe3e6738c200781f681a22a7e6358f39e5/test.c
[2] https://cirrus-ci.com/task/4650412253380608

Attachment Content-Type Size
v5-0001-Provide-thread-safe-pg_localeconv_r.patch text/x-patch 22.5 KB
v5-0002-Use-thread-safe-strftime_l-instead-of-strftime.patch text/x-patch 7.9 KB
v5-0003-Remove-setlocale-from-check_locale.patch text/x-patch 9.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2024-08-19 06:30:23 Re: Use read streams in pg_visibility
Previous Message Michael Paquier 2024-08-19 06:28:52 Re: Normalize queries starting with SET for pg_stat_statements