Re: [INTERFACES] libpq and multi-threading on Linux?

Поиск
Список
Период
Сортировка
От Michael Olivier
Тема Re: [INTERFACES] libpq and multi-threading on Linux?
Дата
Msg-id 19990215184756.10009.rocketmail@send104.yahoomail.com
обсуждение исходный текст
Ответы Re: [INTERFACES] libpq and multi-threading on Linux?  (Peter T Mount <peter@retep.org.uk>)
Список pgsql-interfaces
Peter - thanks for your response -- see comments below.

---Peter T Mount <peter@retep.org.uk> wrote:
>
> On Wed, 10 Feb 1999, Michael Olivier wrote:
>
> > Hi folks,
> >
> > I apologize in advance if I have overlooked docs, but I haven't been
> > able to find a discussion of how PostGreSQL via libpq on Linux fares
> > with pthreads. Can someone point me to docs if available, or
otherwise
> > enlighten me? How well does it work and what are the important
design
> > issues to consider?
> >
> > I'm expecting to create a pool of db connections to use within a
> > long-running process, which will create a new thread for each
incoming
> > request from a client. I've found just a very little bit about PG
> > being multi-processing, but not how it will interact with a
> > multi-threaded client. I appreciate your comments.
>
> Take a look on how I got the JDBC driver to handle multi-threading.

OK, great -- how do I get this? From looking at your web site, I can
see downloadable jdbc6.4.jar, but I'm not doing Java work so don't
have a way to access this - looks like an archive. Can you send me the
source file(s) or post a URL?

> At certain points, the driver obtains a lock on the network connection
> before sending a query, and releases the lock when the query has
finished
> (ie: all results have been returned in to the ResultSet).

Is this so several threads can share one connection, or so that
Postgresql doesn't get screwed up with different threads using
different connections? I think you're saying the former, but I'm not
sure. I'm looking at allocating one connection per thread, so I need
this clarified, i.e., do I need to do locking of some sort or will it
work for me that each thread has a unique DB connection?

> I'm not sure if this is what you were after.

Yes, it's getting at it. Thanks.

--Michael

_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com


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

Предыдущее
От: Wolfgang Hottgenroth
Дата:
Сообщение: psqlodbc under Win3.11 with win32s
Следующее
От: Claudio Cicognani
Дата:
Сообщение: How to start with odbc