Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3d1a1ee

Browse files
committed
Document ways to avoid libpq WSACleanup() overhead on Windows.
Andrew Chernow
1 parent8c78f8e commit3d1a1ee

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

‎doc/src/sgml/libpq.sgml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.275 2009/01/10 20:14:30 momjian Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.276 2009/02/06 18:18:54 momjian Exp $ -->
22

33
<chapter id="libpq">
44
<title><application>libpq</application> - C Library</title>
@@ -63,6 +63,21 @@
6363
The <function>PQstatus</> function should be called to check
6464
whether a connection was successfully made before queries are sent
6565
via the connection object.
66+
67+
<note>
68+
<para>
69+
On Windows, there is a way to improve performance if a single
70+
database connection is repeated started and shutdown. Internally,
71+
libpq calls WSAStartup() and WSACleanup() for connection startup
72+
and shutdown, respectively. WSAStartup() increments an internal
73+
Windows library reference count which is decremented by WSACleanup().
74+
When the reference count is just one, calling WSACleanup() frees
75+
all resources and all DLLs are unloaded. This is an expensive
76+
operation. To avoid this, an application can manually call
77+
WSAStartup() so resources will not be freed when the last database
78+
connection is closed.
79+
</para>
80+
</note>
6681

6782
<variablelist>
6883
<varlistentry>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp