Re: libpq WSACleanup is not needed

Поиск
Список
Период
Сортировка
От Andrew Chernow
Тема Re: libpq WSACleanup is not needed
Дата
Msg-id 49788925.8050905@esilo.com
обсуждение исходный текст
Ответ на Re: libpq WSACleanup is not needed  (Magnus Hagander <magnus@hagander.net>)
Ответы Re: libpq WSACleanup is not needed  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Magnus Hagander wrote:
> Andrew Chernow wrote:
>> Magnus Hagander wrote:
>>> In which case, we should perhaps just document the workaround using
>>> WSAStartup() yourself, and not bother with either API or connection
>>> parameter...
>>>
>>>
>> I didn't originally agree with this but now I do.  Any libpq init
>> function for wsa, would only be replacing an app calling WSAStartup
>> themselves.  So, why have it at all.
> 
> Ok, I think we're fairly agreed that this is the way to proceed then. Do
> you want to propose some wording for the documentation, or should I try
> to write something myself?
> 
> //Magnus
> 
> 

I can try.  Where should this be documented?  ISTM that the best place 
is at the top of "30.1 Database Connection Control Functions", since the 
issue pertains to any connect/disconnect function.  Does that sound 
correct?  Should it be a warning or just regular text?

First attempt:

"On windows, libpq issues a WSAStartup and WSACleanup on a per 
connection basis.  Each WSAStartup increments an internal reference 
count which is decremented by WSACleanup.  Calling WSACleanup with a 
reference count of zero, forces all resources to be freed and DLLs to be 
unloaded.  This is an expensive operation that can take as much as 
300ms.  This overhead can be seen if an application does not call 
WSAStartup and it closes its last PGconn.  To avoid this, an application 
should manually call WSAStartup."

-- 
Andrew Chernow
eSilo, LLC
every bit counts
http://www.esilo.com/


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Euler Taveira de Oliveira
Дата:
Сообщение: Re: deductive databases in postgreSQL
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: Pluggable Indexes (was Re: rmgr hooks (v2))