Re: Can we get rid of TerminateThread() in pg_dump?

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>, Bryan Green <dbryan(dot)green(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Subject: Re: Can we get rid of TerminateThread() in pg_dump?
Date: 2026-07-07 23:40:23
Message-ID: CA+hUKG+4ULA_-bW0Fws8SoJGWgS49d76kB264A7yC8pH=k_joQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jul 7, 2026 at 9:23 AM Heikki Linnakangas <hlinnaka(at)iki(dot)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.)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2026-07-07 23:49:45 Re: SPLIT/MERGE use of is_internal=true
Previous Message Alexander Korotkov 2026-07-07 23:38:56 Re: SQL/JSON json_table plan clause