Обсуждение: threads question

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

threads question

От
"Wright, George"
Дата:

Can I open a connection to a PostgreSQL database from some C/C++ code then share the connection handle with multiple threads in the C/C++ environment?

 

I wanted to be able to call a stored procedure from each of the threads using a different id for each.

Re: threads question

От
Tom Lane
Дата:
"Wright, George" <George.Wright@infimatic.com> writes:
> Can I open a connection to a PostgreSQL database from some C/C++ code
> then share the connection handle with multiple threads in the C/C++
> environment?

Sure, but it's up to you to prevent the threads from trying to do more
than one thing at a time with the connection.

            regards, tom lane