Re: Win32 signal code - first try - Mailing list pgsql-hackers-win32

From Claudio Natoli
Subject Re: Win32 signal code - first try
Date
Msg-id A02DEC4D1073D611BAE8525405FCCE2B55F254@harris.memetrics.local
Whole thread Raw
List pgsql-hackers-win32

> > Yes, this fine for polling, but what about when the backend
> > is *sleeping*?  As I understand the backend main processing
> > loop, (and my understanding is far from complete...) the
> > backend waits on 'read from socket' when it is not doing
> > anything.  Correct me if I'm wrong, but this is not
> > interruptible from an APC.
> It is if you use WaitForMultipleObjectsEx(). Or if you use
> WSAEventSelect() and then WaitForSingleObjectEx() on the event (this
> emulates select() the closest)

I'd just as soon as avoid WSAEventSelect; I think that will complicate
matters quite a bit.

FWIW, in a multithreaded version of postgres I'm fooling around with, I
replaced the recv call (where backends spend most of their time waiting)
which a select(small timeout)/SleepEx(0) "busy" loop, which calls to recv
when ready. Works just fine.

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>

pgsql-hackers-win32 by date:

Previous
From: "Merlin Moncure"
Date:
Subject: Re: Win32 signal code - first try
Next
From: "Magnus Hagander"
Date:
Subject: Re: Win32 signal code - first try