Hello list, 

just a quick question or two regarding the use of libpqxx in a 
multithreaded program. When using a peer-to-peer thread model [1] is it 
safe to have each thread get a reference to the pqxx::connection C 
created in the main thread? Or does each thread have to create its own 
connection to the database? I suspect the latter is the case.

I am quite new to multithreaded programming and still have to get used 
to some concepts but as far as I understand the ACID principle no 
concurrency issues should arise when reading from and writing to a 
database like Postgres from multiple threads, and no mutexes are 
required for such (but only such) operations either.

Are my assumptions and conclusions correct?

Thanks in advance!

Andreas

[1] http://www.phptr.com/articles/article.asp?p=169479&seqNum=5&rl=1
-- 
Andreas "daff" Ntaflos 
Vienna, Austria 

GPG Fingerprint: 6234 2E8E 5C81 C6CB E5EC  7E65 397C E2A8 090C A9B4

Attachment: pgp6zJZm8KyC4.pgp
Description: PGP signature

_______________________________________________
Libpqxx-general mailing list
[email protected]
http://gborg.postgresql.org/mailman/listinfo/libpqxx-general

Reply via email to