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 Tom Lane <tgl@sss.pgh.pa.us>
RE: Multi-threaded client apps "JGL" <info@designthenet.com>
"Gunkel, Marc B"  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...
FAQ