Re: Multiplexing SUGUSR1 - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Multiplexing SUGUSR1
Date
Msg-id 493D31BF.2040704@enterprisedb.com
Whole thread Raw
In response to Re: Multiplexing SUGUSR1  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Multiplexing SUGUSR1  ("Fujii Masao" <masao.fujii@gmail.com>)
List pgsql-hackers
Tom Lane wrote:
> Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
>> To set or clear the flag from PGPROC, to send or handle a signal, we 
>> have to acquire ProcArrayLock. Is that safe to do in a signal handler? 
> 
> No.  If it's trying to do that then it's broken.  In fact, if it's
> trying to do much of anything beyond setting a "volatile" flag variable
> in a signal handler, it's broken --- unless there are special provisions
> to limit where the signal trap can occur, which would be pretty much
> unacceptable for a multiplexed-signal implementation.

Ok, I was afraid so.

I think we'll need to replace the proposed bitmask with an array of 
sig_atomic_t flags then, and do without locking.

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: new vacuum is slower for small tables
Next
From: Simon Riggs
Date:
Subject: Re: Synchronous replication: reading recovery.conf