Re: Trying out <stdatomic.h>

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Trying out <stdatomic.h>
Date: 2025-11-13 11:35:48
Message-ID: CA+hUKG+bub1T9TFLUAJHr+Z519VRgJS5tb10xBxEtJZRH8GXiA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Nov 11, 2025 at 2:57 AM Heikki Linnakangas <hlinnaka(at)iki(dot)fi> wrote:
> > [PATCH v1 1/4] Add some missing #include <limits.h>.
>
> This seems like a good thing regardless of the other patches.

Pushed.

> The patch removes 'src/template/solaris'. Is that on purpose?

Fixed.

It passes with VS 2022 on CI. I had to skip some assertions about
macros promising lock-free implementation, that it doesn't define in C
mode yet. They are definitely lock-free though[1], and the macros are
defined for C++, and the same under the covers... Perhaps
feature/conformance macros won't be defined until a few remaining
pieces (things we don't care about) are accessible from C? (I see
that Visual Studio 2026 has also just shipped a couple of days ago,
not investigated.)

[1] https://devblogs.microsoft.com/cppblog/c11-atomics-in-visual-studio-2022-version-17-5-preview-2/

Attachment Content-Type Size
v2-0001-ci-Use-Visual-Studio-2022-for-stdatomic.h.patch application/octet-stream 1.2 KB
v2-0002-Enable-Visual-Studio-s-stdatomic.h-support.patch application/octet-stream 790 bytes
v2-0003-Redefine-port-atomics.h-on-top-of-stdatomic.h.patch application/octet-stream 68.1 KB
v2-0004-Use-atomics-API-to-implement-spinlocks.patch application/octet-stream 35.8 KB
v2-0005-Remove-configure-meson-checks-for-atomics.patch application/octet-stream 16.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message jian he 2025-11-13 11:51:00 Re: Extended Statistics set/restore/clear functions.
Previous Message Amit Kapila 2025-11-13 11:30:51 Re: Issue with logical replication slot during switchover