pThread and libpq problem

Поиск
Список
Период
Сортировка
От Brendan Rempel
Тема pThread and libpq problem
Дата
Msg-id 35E3018E.17736CEA@cybersoft.ab.ca
обсуждение исходный текст
Список pgsql-interfaces
Hello,

I just started using libpq.  I got a single process accessing and
quering a database without a hitch.  But when I copied the code to a
pthread callback function, I get an immediate "segmentation fault"
(running under Red-Hat Linux release 5.0 on i586).  I thinned out all
the necessary code to reproduce this error and tracked it down to a
single call:

void *server(void *arg)
{
   PGconn conn = PQsetdb(pghostNull, pgportNull, pgoptionsNull,
pgttyNull,DbName);
   ...

This code has no problems running in a single threaded executable.  I
read back issues of this mailing list and found several people using
libpq in multithreaded programs, so I am probably doing something
obviously wrong.  I don't know if it matters, but I am using C++ with
libpq C library.  But if anybody can help me, it would be appreciated.

Thanks in advance,

Brendan


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

Предыдущее
От: Giorgio Volpe
Дата:
Сообщение: How specify user& pwd for Pg
Следующее
От: Gerald Gryschuk
Дата:
Сообщение: Re: [INTERFACES] iodbc interface on Unix