Lists: | pgsql-hackers |
---|
From: | Claudio Natoli <claudio(dot)natoli(at)memetrics(dot)com> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Cc: | 'Magnus Hagander' <mha(at)sollentuna(dot)net> |
Subject: | socket calls in signal handler (WAS: APC + socket restrictions un der Win32?) |
Date: | 2004-03-08 10:12:52 |
Message-ID: | A02DEC4D1073D611BAE8525405FCCE2B55F362@harris.memetrics.local |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
Hi all,
Was just discussing the issues related to the above off list with Magnus:
http://archives.postgresql.org/pgsql-hackers-win32/2004-03/msg00041.php
Whilst we can think of a number of work-arounds (the simplest being a
suggestion by Magnus: set a flag, like APCcalled, to false before the
select() call, and repeat the select() if APCcalled == true on return from
select), we were wondering if having socket calls inside signal handlers was
a good idea in any case?
The specific (and possibly only? are their others?) issue is the call to
pgstat_beterm from reaper/CleanupProc, invoked by a SIGCHLD. Can this call
be deferred to the main loop (ie. ServerLoop) and is there any merit in
doing so?
[Seems like pgstat_fetch_stat_numbackends could get seriously out of date,
in pathological scenarios... other gotchas?]
Cheers,
Claudio
---
Certain disclaimers and policies apply to all email sent from Memetrics.
For the full text of these disclaimers and policies see
<a
href="http://www.memetrics.com/emailpolicy.html">http://www.memetrics.com/em
ailpolicy.html</a>
From: | Kurt Roeckx <Q(at)ping(dot)be> |
---|---|
To: | Claudio Natoli <claudio(dot)natoli(at)memetrics(dot)com> |
Cc: | pgsql-hackers(at)postgresql(dot)org, 'Magnus Hagander' <mha(at)sollentuna(dot)net> |
Subject: | Re: socket calls in signal handler (WAS: APC + socket restrictions un der Win32?) |
Date: | 2004-03-08 18:12:00 |
Message-ID: | 20040308181200.GA4173@ping.be |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
On Mon, Mar 08, 2004 at 09:12:52PM +1100, Claudio Natoli wrote:
>
> Hi all,
>
> Was just discussing the issues related to the above off list with Magnus:
> http://archives.postgresql.org/pgsql-hackers-win32/2004-03/msg00041.php
>
> Whilst we can think of a number of work-arounds (the simplest being a
> suggestion by Magnus: set a flag, like APCcalled, to false before the
> select() call, and repeat the select() if APCcalled == true on return from
> select), we were wondering if having socket calls inside signal handlers was
> a good idea in any case?
Is this a win32 only thing, or is it more general?
OpenBSD for instance has some documentation on which functions
are safe to be called from a signal handler, and socket
operations aren't part of it. See for isntance their manpages
about signal and sigaction.
Kurt