Re: [HACKERS] Possible explanation for Win32 stats regression test

From: "korryd(at)enterprisedb(dot)com" <korryd(at)enterprisedb(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org, pgsql-patches(at)postgresql(dot)org
Subject: Re: [HACKERS] Possible explanation for Win32 stats regression test
Date: 2006-07-29 12:18:33
Message-ID: 1154175513.7099.51.camel@sakai.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

> Is anyone working on this?
>
> Tom Lane wrote:
> > korry <korry(at)appx(dot)com> writes:
> > > The problem is that, each time you go through
> > > pgwin32_waitforsinglesocket(), you tie the *same* kernel object
> > > (waitevent is static) to each socket.
> >
> > > The fix is pretty simple - just call WSAEventSelect( s, waitevent, 0 )
> > > after WaitForMultipleObjectsEx() returns. That disassociates the socket
> > > from the Event (it will get re-associated the next time
> > > pgwin32_waitforsingleselect() is called.
> >
> > Hmm. Presumably we don't do this a whole lot (use multiple sockets) or
> > we'd have noticed before. Perhaps better would be to keep an additional
> > static variable saying which socket the event is currently associated
> > to, and only issue the extra WSAEventSelect calls if we need to change
> > it. Or is WSAEventSelect fast enough that it doesn't matter?
> >

Here's a simple patch that fixes the problem (I haven't explored the
performance of this patch compared to Tom's suggestion).

-- Korry

Attachment Content-Type Size
socket.patch text/x-patch 1.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2006-07-29 13:31:31 Re: On-disk bitmap index patch
Previous Message Tzahi Fadida 2006-07-29 10:37:44 Re: Formulating an sql query with CTID

Browse pgsql-patches by date

  From Date Subject
Next Message Andrew Dunstan 2006-07-29 14:21:05 Re: [HACKERS] Possible explanation for Win32 stats regression
Previous Message Joe Conway 2006-07-29 06:50:05 Re: [HACKERS] 8.2 features?