Re: Multi-threaded client apps

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Multi-threaded client apps
Дата
Msg-id 21900.982012771@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Multi-threaded client apps  ("Gunkel, Marc B" <mgunke@sandia.gov>)
Ответы RE: Multi-threaded client apps
Список pgsql-novice
"Gunkel, Marc B" <mgunke@sandia.gov> writes:
> Can each client thread have its own connection?

That should work.

> What happens if multiple threads share one connection? For instance, can one
> thread open a connection and another thread close it?

Not a good idea unless you provide a mutex to ensure that only one
thread manipulates the PGconn object at a time.

Basically, libpq is thread-safe (in recent releases) but not thread-aware.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Mac OS X Beta Status?
Следующее
От: Ken Corey
Дата:
Сообщение: My apologies...