Skip site navigation (1) Skip section navigation (2)

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

From: Michael Olivier <molivier(at)yahoo(dot)com>
To: Peter T Mount <peter(at)retep(dot)org(dot)uk>
Cc: pgsql interfaces <pgsql-interfaces(at)postgreSQL(dot)org>
Subject: Re: [INTERFACES] libpq and multi-threading on Linux?
Date: 1999-02-15 18:47:56
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces
Peter - thanks for your response -- see comments below.

---Peter T Mount <peter(at)retep(dot)org(dot)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
> > enlighten me? How well does it work and what are the important
> > 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
> > 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
> (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.


Get your free address at


pgsql-interfaces by date

Next:From: Peter T MountDate: 1999-02-15 19:50:31
Subject: Re: [INTERFACES] libpq and multi-threading on Linux?
Previous:From: Wolfgang HottgenrothDate: 1999-02-15 18:37:51
Subject: psqlodbc under Win3.11 with win32s

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group