libpqxx  v4.0-1
C++ library for PostgreSQL
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pqxx::thread_safety_model Struct Reference

Descriptor of library's thread-safety model. More...

#include <util.hxx>

Collaboration diagram for pqxx::thread_safety_model:

Public Attributes

PGSTD::string description
 A human-readable description of any thread-safety issues. More...
 
bool have_safe_strerror
 Does standard C library have a thread-safe alternative to strerror? More...
 
bool safe_kerberos
 Is Kerberos thread-safe? More...
 
bool safe_libpq
 Is the underlying libpq build thread-safe? More...
 
bool safe_query_cancel
 Is canceling queries thread-safe? More...
 
bool safe_result_copy
 Are copies of pqxx::result and pqxx::binarystring objects thread-safe? More...
 

Detailed Description

Descriptor of library's thread-safety model.

This describes what the library knows about various risks to thread-safety.

Member Data Documentation

PGSTD::string pqxx::thread_safety_model::description

A human-readable description of any thread-safety issues.

bool pqxx::thread_safety_model::have_safe_strerror

Does standard C library have a thread-safe alternative to strerror?

If not, its strerror implementation may still be thread-safe. Check your compiler's manual.

Without strerror_r (strerror_s in Visual C++) or a thread-safe strerror, the library can't safely obtain descriptions of certain run-time errors. In that case, your application must serialize all use of libpqxx.

bool pqxx::thread_safety_model::safe_kerberos

Is Kerberos thread-safe?

Warning
Is currently always false.

If your application uses Kerberos, all accesses to libpqxx or Kerberos must be serialized. Confine their use to a single thread, or protect it with a global lock.

bool pqxx::thread_safety_model::safe_libpq

Is the underlying libpq build thread-safe?

A "false" here may mean one of two things: either the libpq build is not thread-safe, or it is a thread-safe build of an older version that did not offer thread-safety information.

In that case, the best fix is to rebuild libpqxx against (a thread-safe build of) a newer libpq version.

bool pqxx::thread_safety_model::safe_query_cancel

Is canceling queries thread-safe?

If not, avoid use of the pqxx::pipeline class in threaded programs. Or better, rebuild libpqxx against a newer libpq version.

bool pqxx::thread_safety_model::safe_result_copy

Are copies of pqxx::result and pqxx::binarystring objects thread-safe?

If true, it's safe to copy an object of either of these types (copying these is done very efficiently, so don't worry about data size) and hand the copy off to another thread. The other thread may access the copy freely without any concurrency concerns.


The documentation for this struct was generated from the following file: