Re: Patch for select and APC on win32 - Mailing list pgsql-patches

From Magnus Hagander
Subject Re: Patch for select and APC on win32
Date
Msg-id 6BCB9D8A16AC4241919521715F4D8BCE34B5A5@algol.sollentuna.se
Whole thread Raw
In response to Patch for select and APC on win32  ("Magnus Hagander" <mha@sollentuna.net>)
List pgsql-patches
> > Here's a patch implementing the "thread method" to
> workaround the bug
> > with socket calls in signal handlers. See details in mail to
> > pgsql-hackers-win32 a couple of minutes ago.
>
> Looks ok, but wouldn't it be better placed in pgstat.c?

Actually, I don't think so. I considered it, and chose to put it in
postmaster.c for the following reason:

The functon pgstat_beterm itself is *not* the problem. In theory, it can
be called from places that are not signal handlers (sure, it's not done
today I think, but internal-API-wise, it could). That goes against
putting the fix ther.

Also, by putting the code inside the actual signal handler function, we
put the fix close to the problem, which makes it more visible in the
"trouble area". The problem is, IMHO, in the signal handler, and not in
the actual pgstat function.

I'll be happy to change this if you still think it's better, but I
figured I shuold put out my argument for doing what I did first :-)

//Magnus

pgsql-patches by date:

Previous
From: "Magnus Hagander"
Date:
Subject: Re: Initial eventlog support on win32
Next
From: Karel Zak
Date:
Subject: Re: pstrndup()