Re: Can we get rid of TerminateThread() in pg_dump? - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: Can we get rid of TerminateThread() in pg_dump?
Date
Msg-id CA+hUKG+4ULA_-bW0Fws8SoJGWgS49d76kB264A7yC8pH=k_joQ@mail.gmail.com
Whole thread
In response to Re: Can we get rid of TerminateThread() in pg_dump?  (Heikki Linnakangas <hlinnaka@iki.fi>)
Responses Re: Can we get rid of TerminateThread() in pg_dump?
List pgsql-hackers
On Tue, Jul 7, 2026 at 9:23 AM Heikki Linnakangas <hlinnaka@iki.fi> wrote:
> In this case, though, I think all we need is a "volatile sigatomic_t"
> flag. Sending the query cancellation over the network surely acts as a
> full compiler and memory barrier in the cancelling thread. And similarly
> receiving the error message from the network acts as a full barrier in
> the other threads that might receive the cancellation error from the
> backend.

You're right.  So basically Jelte's patch, except it doesn't need the
Win32 atomics stuff, just volatile, and a comment to explain that
assumption.  (Then some later version could use an explicit barrier
instead of a comment, I guess, just to be clearer.)



pgsql-hackers by date:

Previous
From: Alexander Korotkov
Date:
Subject: Re: SQL/JSON json_table plan clause
Next
From: Jeff Davis
Date:
Subject: Re: Fix unqualified catalog references in psql describe queries