Thread: libpq: Exact meaning of 'thread-safe'?

libpq: Exact meaning of 'thread-safe'?

From
Florian Weimer
Date:
From the documentation:

| libpq is thread-safe as of Postgres 7.0, so long as no two threads
| attempt to manipulate the same PGconn object at the same time. In
| particular, you can't issue concurrent queries from different threads
| through the same connection object. (If you need to run concurrent
| queries, start up multiple connections.)

Is it safe to perform sequential queries from different threads to the
same object?  (On some systems, the process ID changes from thread to
thread, and this could have some side effects.)

Is it safe to assume that the accessor functions for connection
objects are task-safe and will remain it?

-- 
Florian Weimer                       Florian.Weimer@RUS.Uni-Stuttgart.DE
University of Stuttgart           http://cert.uni-stuttgart.de/
RUS-CERT                          +49-711-685-5973/fax +49-711-685-5898