Thread: threads question

threads question

From
"Wright, George"
Date:

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

From
Tom Lane
Date:
"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