On 10/11/2025 15:17, Thomas Munro wrote:
Hi,
Here is an experimental patch to try out standard C (and C++) atomics
to implement port/atomics.h, and also add more types and operations.
It's mostly just redirecting our names to the standard ones, except
for our barriers and slightly extended pg_atomic_flag, so there isn't
much left of the code.
9 files changed, 166 insertions(+), 1824 deletions(-)
...
8 files changed, 176 insertions(+), 881 deletions(-)
...
7 files changed, 1 insertion(+), 394 deletions(-)
Nice!
[PATCH v1 1/4] Add some missing #include <limits.h>.
This seems like a good thing regardless of the other patches.
The "#include <limits.h>" lines in src/backend/lib/dshash.c and
src/backend/storage/lmgr/condition_variable.c are slightly misplaced:
system headers should be included between "postgres.h" and other
postgres headers.
Here also is a semi-independent patch to implement storage/spin.h with
pg_atomic_flag. It keeps a small amount of the architecture-specific
magic, but moves it out to src/port/spin_delay.h.
Makes sense.
The patch removes 'src/template/solaris'. Is that on purpose? Is that an
independent cleanup that could be committed immediately?
- Heikki