2010/2/2 Przemysław Czerpak <dru...@acn.waw.pl>:

> Check if libpq is fully MT safe.

Thanks for the answer. This is what I've found in
http://www.enterprisedb.com/documentation/libpq-concepts.html:

...

29.4.16. Behavior in Threaded Programs

libpq is reentrant and thread-safe if the configure command-line
option --enable-thread-safety was used when the EnterpriseDB
distribution was built. In addition, you might need to use additional
compiler command-line options when you compile your application code.
Refer to your system's documentation for information about how to
build thread-enabled applications, or look in src/Makefile.global for
PTHREAD_CFLAGS and PTHREAD_LIBS. This function allows the querying of
libpq's thread-safe status:

Returns 1 if the libpq is thread-safe and 0 if it is not.

One thread restriction is that no two threads attempt to manipulate
the same PGconn object at the same time. In particular, you cannot
issue concurrent commands from different threads through the same
connection object. (If you need to run concurrent commands, use
multiple connections.)

PGresult objects are read-only after creation, and so can be passed
around freely between threads.

The deprecated functions PQrequestCancel and PQoidStatus are not
thread-safe and should not be used in multithread programs.
PQrequestCancel can be replaced by PQcancel. PQoidStatus can be
replaced by PQoidValue.

If you are using Kerberos inside your application (in addition to
inside libpq), you will need to do locking around Kerberos calls
because Kerberos functions are not thread-safe. See function
PQregisterThreadLock in the libpq source code for a way to do
cooperative locking between libpq and your application.

If you experience problems with threaded applications, run the program
in src/tools/thread to see if your platform has thread-unsafe
functions. This program is run by configure, but for binary
distributions your library might not match the library used to build
the binaries.
...

Do you think I can found not thread-safe libpq in distros like Centos,
Fedora, Ubuntu?

best regards,
Lorenzo
_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to