Re: socket calls in signal handler (WAS: APC + socket restrictions un der Win32?)

From: "Magnus Hagander" <mha(at)sollentuna(dot)net>
To: "Kurt Roeckx" <Q(at)ping(dot)be>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Claudio Natoli" <claudio(dot)natoli(at)memetrics(dot)com>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: socket calls in signal handler (WAS: APC + socket restrictions un der Win32?)
Date: 2004-03-08 23:11:01
Message-ID: 6BCB9D8A16AC4241919521715F4D8BCE171602@algol.sollentuna.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>> >The postmaster's use of nominally unsafe stuff in signal
>> >handlers is not
>> >and never has been a problem, because there is only one place in the
>> >main loop where signals are unblocked, thus no possibility for
>> >something
>> >to interrupt something else. I don't like the idea of
>redesigning that
>> >code just because someone misunderstands it.
>>
>>
>> You're saying the above is not valid because we block signals?
>
>It's all about reentrance of functions where it's not safe to do
>so.
>
>Either you avoid it in the signal handler or you avoid it by only
>allowing it during a "safe" period.

Ok. Let me try to get this straight :-)

Since we *only* permit signals during the select() call, we are safe as
long as we don't call select() inside the signal handlers? (since
select() is not on the list of safe functions). Which we don't.

That makes sense :-)

If that is indeed the case, I withdraw all my comments and misdirected
ideas, and say we go for a win32 specific workaround :-)

//Magnus

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2004-03-08 23:25:14 Catching up
Previous Message Kurt Roeckx 2004-03-08 22:55:20 Re: socket calls in signal handler (WAS: APC + socket restrictions un der Win32?)