Re: libpq WSACleanup is not needed

From: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
To: "Magnus Hagander" <magnus(at)hagander(dot)net>
Cc: "Andrew Chernow" <ac(at)esilo(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: libpq WSACleanup is not needed
Date: 2009-01-16 14:48:27
Message-ID: b42b73150901160648l61e977aek97f0dc18c1421bf0@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 1/16/09, Magnus Hagander <magnus(at)hagander(dot)net> wrote:
> Andrew Chernow wrote:
> > WSACleanup is not really needed during a PQfinish. Its horribly slow if
> > the library ref count is 0 and it actually unloads the winsock library,
> > adds 225ms to PQfinish.
>
> Option A will make us leak the reference to it though, won't it? And we
> are supposed to clean up after ourselves...
>
> If you want to override this behavior today, you can just call
> WSAStartup() in your application, and it should never happen. Right?
>
> Now, if we actually had libpq_init()/uninit() or something like it, it
> would make sense to move it there. But I'm not sure we want to just leak
> the reference. But I'm not entirely convinced either way :-)

I think init/uninit is the answer. While writing libpqtypes, we noted
that libpq is just plain awkward in a few different ways and probably
deserves a rewrite at some point. not today though....

merlin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2009-01-16 14:51:44 Re: links in buildfarms report are broken
Previous Message Andrew Chernow 2009-01-16 14:44:18 Re: libpq WSACleanup is not needed