Re: Interrupts vs signals

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Robert Haas <robertmhaas(at)gmail(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Interrupts vs signals
Date: 2025-02-28 20:24:56
Message-ID: 8a507fb6-df28-49d3-81a5-ede180d7f0fb@iki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 28/01/2025 19:01, Andres Freund wrote:
> On 2024-12-02 16:39:28 +0200, Heikki Linnakangas wrote:
>> This also moves the WaitEventSet functions to a different source file,
>> waiteventset.c. This separates the platform-dependent code waiting and
>> signalling code from the platform-independent parts.
>
> I think this should be split into a separate commit. It's painful to verify
> that code-movement didn't change anything else if there's lots of other
> changes in the same commit.

Here's a patch set to do just that, split WaitEventSet stuff to a
separate source file. That's actually a pretty nice separation even
without any of the rest of the patches.

I noticed that the ShutdownLatchSupport() function is unused. The first
patch removes it.

The second patch makes it possible to use ModifyWaitEvent() to switch
between WL_POSTMASTER_DEATH and WL_EXIT_ON_PM_DEATH. WaitLatch() used to
modify WaitEventSet->exit_on_postmaster_death directly, now it uses
ModifyWaitEvent() for that. That's needed because with the final patch,
WaitLatch() is in a different source file than WaitEventSet, so it
cannot directly modify its field anymore.

The third patch is mechanical and moves existing code. The file header
comments in the modified files are perhaps worth reviewing. They are
also just existing text moved around, but there was some small decisions
on what exactly should go where.

I'll continue working on the other parts, but these patches seems ready
for commit already.

--
Heikki Linnakangas
Neon (https://neon.tech)

Attachment Content-Type Size
0001-Remove-unused-ShutdownLatchSupport-function.patch text/x-patch 1.8 KB
0002-Use-ModifyWaitEvent-to-update-exit_on_postmaster_dea.patch text/x-patch 3.4 KB
0003-Split-WaitEventSet-functions-to-separate-source-file.patch text/x-patch 126.4 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Isaac Morland 2025-02-28 20:29:46 Re: making EXPLAIN extensible
Previous Message Jeff Davis 2025-02-28 20:10:37 Re: Statistics Import and Export: difference in statistics dumped