Re: the s_lock_stuck on perform_spin_delay - Mailing list pgsql-hackers

From Robert Haas
Subject Re: the s_lock_stuck on perform_spin_delay
Date
Msg-id CA+TgmobMJLKnsR_pLnOmRdb7+AzCLdNPFOqG4TAatU1F_4gyaQ@mail.gmail.com
Whole thread Raw
In response to Re: the s_lock_stuck on perform_spin_delay  (Andy Fan <zhihuifan1213@163.com>)
Responses Re: the s_lock_stuck on perform_spin_delay
List pgsql-hackers
On Mon, Jan 8, 2024 at 9:40 PM Andy Fan <zhihuifan1213@163.com> wrote:
> The singler handler I was refering to is 'CHECK_FOR_INTERRUPTS', Based
> on this, spin_lock and lwlock are acted pretty differently.

CHECK_FOR_INTERRUPTS() is not a signal handler, and it's OK to acquire
and release spin locks or lwlocks there. We have had (and I think
still do have) cases where signal handlers do non-trivial work,
resulting in serious problems in some cases. A bunch of that stuff has
been rewritten to just set a flag and then let the calling code sort
it out, but not everything has been rewritten that way (I think) and
there's always a danger of future hackers introducing new problem
cases.

--
Robert Haas
EDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_dump: Remove obsolete trigger support
Next
From: Melanie Plageman
Date:
Subject: Re: Emit fewer vacuum records by reaping removable tuples during pruning