From: | "Magnus Hagander" <mha(at)sollentuna(dot)net> |
---|---|
To: | "Andrew Dunstan" <andrew(at)dunslane(dot)net>, "pgsql-hackers-win32" <pgsql-hackers-win32(at)postgresql(dot)org> |
Subject: | Re: Win32 signal code - first try |
Date: | 2004-01-09 08:44:22 |
Message-ID: | 6BCB9D8A16AC4241919521715F4D8BCE2A6A62@algol.sollentuna.se |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers-win32 |
> >Hmm. Depending on how often we need to poll (meaning how
> often we need
> >to deliver signals), perhaps we can go with the WFSOEx
> method anyway.
> >The code would be slightly easier: I've attached a version that uses
> >this one instead.
> >
> >(You'd probably move the WaitFor()... call into the #define as well)
> >
> >Looking at this code, I'm thinking we can probably do away with the
> >critical section alltogether. All that code now executes on the main
> >thread. Does this seem correct?
> >
> >
> >
>
> I understood your first version better than I understand this
> one. What
> calls __pg_poll_signals()? As I understand the first version, we
> wouldn't need to put any polling calls into the main thread
> code - the
> signal detector would just queue a call to pg_signal_apc() on
> the main
> thread as needed, which would in turn do some cleanup and call the
> signal handler. That seems to me to be *very* clean and nice. Am I
> missing something? (As you can no doubt tell, IANAWP :-) )
No, we need to poll from the main thread. In the first code, with a
check of the counter. In the second code with calls to
WaitForSingleObjectEx(). Otherwise, the APCs won't get delivered.
//Magnus
From | Date | Subject | |
---|---|---|---|
Next Message | Claudio Natoli | 2004-01-09 10:15:39 | Re: Win32 signal code - first try |
Previous Message | Magnus Hagander | 2004-01-09 08:42:55 | Re: Win32 signal code - first try |