Re: libpq WSACleanup is not needed - Mailing list pgsql-hackers

From Andrew Chernow
Subject Re: libpq WSACleanup is not needed
Date
Msg-id 4975FB20.30505@esilo.com
Whole thread Raw
In response to Re: libpq WSACleanup is not needed  (Jeroen Vermeulen <jtv@xs4all.nl>)
Responses Re: libpq WSACleanup is not needed
List pgsql-hackers
Jeroen Vermeulen wrote:
> 
> Would there be any serious harm in:
> 
> 1. doing the WSAStartup() when the first connection is opened, but
> 

The only problem is how to detect the first connection.  In a threaded 
environment you'd have to perform locking in connectdb, which is 
probably not going to fly.
>>but does it say something similar about shutdown?
From the WSACleanup docs:

"The WSACleanup function typically leads to protocol-specific helper 
DLLs being unloaded. As a result, the WSACleanup function should not be 
called from the DllMain function in a application DLL. This can 
potentially cause deadlocks"

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


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: FWD: Re: Updated backslash consistency patch
Next
From: Andrew Chernow
Date:
Subject: Re: libpq WSACleanup is not needed