Обсуждение: libpq++ and threads

Поиск
Список
Период
Сортировка

libpq++ and threads

От
"Glenn MacGregor"
Дата:
Hi All,

I am new to libpq++ so if this was asked already I am sorry (I have searched
the logs).  I have written a threaded app which I am moving to interface
with a postgres database.  Tha app receives messages and passes each message
to a thread with inserts or updates the database.  I have one pgDatabase
object which all the threads use.  Can these threads all access that object
or do I need to syncronize them?
   Thanks

           Glenn



Re: libpq++ and threads

От
Дата:
> I am new to libpq++ so if this was asked already I am sorry (I have
> searched the logs).  I have written a threaded app which I am moving to
> interface with a postgres database.  Tha app receives messages and
> passes each message to a thread with inserts or updates the database. 
> I have one pgDatabase object which all the threads use.  Can these
> threads all access that object or do I need to syncronize them?

That's strictly a libpq issue; libpq++ builds on top of that, but doesn't 
add any threading problems on top of that that I'm aware of.  So if it 
works under libpq, it's going to work on libpq++ and vice versa.  (Unless 
I'm very much mistaken, of course.)


Jeroen