RE: Multi-threaded client apps
| От | JGL |
|---|---|
| Тема | RE: Multi-threaded client apps |
| Дата | |
| Msg-id | NDBBKHNOCKIMKLFEONMFGEGGEKAA.info@designthenet.com обсуждение исходный текст |
| Ответ на | Re: Multi-threaded client apps (Tom Lane <tgl@sss.pgh.pa.us>) |
| Список | pgsql-novice |
-----Original Message-----
From: pgsql-novice-owner@postgresql.org
[mailto:pgsql-novice-owner@postgresql.org]On Behalf Of Tom Lane
Sent: Monday, February 12, 2001 4:20 PM
To: Gunkel, Marc B
Cc: 'pgsql-novice@postgresql.org'
Subject: Re: [NOVICE] Multi-threaded client apps
"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 по дате отправления: