Re: C11 / VS 2019
Thomas Munro <thomas.munro@gmail.com>
From: Thomas Munro <thomas.munro@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Yura Sokolov <y.sokolov@postgrespro.ru>,
Michael Paquier <michael@paquier.xyz>, Nathan Bossart <nathandbossart@gmail.com>,
Peter Eisentraut <peter@eisentraut.org>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2025-06-03T20:46:31Z
Lists: pgsql-hackers
On Wed, Jun 4, 2025 at 2:02 AM Tom Lane <tgl@sss.pgh.pa.us> wrote: > Yura Sokolov <y.sokolov@postgrespro.ru> writes: > > Will it mean we can implement atomics in term of C11 atomics? > > Any such change would have to be supported by extensive performance > testing to verify that there's not a regression on any supported > platform. Yeah, it'd be cool if we could rip out a lot of that > code, but we aren't going to just rip on faith. FWIW I posted an experimental patch like that at: https://www.postgresql.org/message-id/flat/CA%2BhUKG%2Bw-2RyyYUte_mSAunoRE00bQUCG44%3DFiOuyMaN-6uoOw%40mail.gmail.com#60354fbd9784c58d3eeaf9a4193a7414 To make progress down this path, yeah, we'd definitely want to do a bunch of cross-platform evaluation work, ie performance valuation and probably reading assembler. Note that in that experiment I just mapped to the non-_explicit() variants (in other words all the operations are defaulting to memory_order_seq_cst, which is too strong in many cases), so we'd also what to think hard about which of the pg_atomics operations should use _explicit() with a weaker memory_order. Nearby there are also patches to change our spinlocks to use pg_atomics, so then that just becomes standard C11 code too. Assuming all that can be ironed out, AFAIK there is only one piece that we'll still need to hand-roll, because C11 doesn't provide anything like it: pg_spin_delay_impl(). (I haven't looked into whether there is anything standard proposed to deal with that in some future C.)
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Raise C requirement to C11
- f5e0186f865c 19 (unreleased) landed
-
meson: Move C99 test earlier
- 4a4038068bb2 19 (unreleased) landed
-
Enable MSVC conforming preprocessor
- 8fd9bb1d9654 19 (unreleased) landed
-
Make parseNodeString() C idiom compatible with Visual Studio 2015.
- f9f31aa91f82 16.0 cited