Re: [INTERFACES] libpq + multiple connections ...

Поиск
Список
Период
Сортировка
От Roberto Joao Lopes Garcia
Тема Re: [INTERFACES] libpq + multiple connections ...
Дата
Msg-id 3.0.5.32.19991129101959.007a1490@pop.hipernet.com.br
обсуждение исходный текст
Ответ на Re: [INTERFACES] libpq + multiple connections ...  ("E.E. Mellor" <eem21@cam.ac.uk>)
Ответы Re: [INTERFACES] libpq + multiple connections ...
Список pgsql-interfaces
>> safely run two PQconnectdb() calls in parallel.  But you can open two
>> connections in sequence and then use them in parallel; 
>

So I could open, for exemple, 5 db connections (with PQconnectdb()) and
then create 5 threads and use those connections in eache thread. But how
about use PQreset() or PQfinish() inside the new created threads?

I used to test connection before send a query like bellow:

if(PQstatus(con)==CONNECTION_BAD) {  PQreset(con);  if(PQstatus(con)==CONNECTION_BAD) erro_fatal();
}

Should I protect the calls to those functions by an mutex?? Could it
work??? Which functions read or alter Qconnectdb()'s  static array??

I think it is important to mark wich  functions in Libpq is thread safe or
not.

Roberto




В списке pgsql-interfaces по дате отправления:

Предыдущее
От: bbarnes@operamail.com (Bill Barnes)
Дата:
Сообщение: pgaccess on win95 connection
Следующее
От: Enrique Rodriguez Lazaro
Дата:
Сообщение: Problems whit insert from psql