Received: from gemini.cybersurf.net (IDENT:root@gemini.cybersurf.net [209.197.128.8]) by hub.org (8.9.2/8.9.1) with ESMTP id DAA68924 for ; Thu, 11 Feb 1999 03:52:45 -0500 (EST) (envelope-from rempelb@cybersurf.net) Received: from cybersurf.net (pc15.cybersurf.net [209.197.144.15]) by gemini.cybersurf.net (8.8.7/8.8.7) with ESMTP id BAA29269 for ; Thu, 11 Feb 1999 01:52:43 -0700 Message-ID: <36C29BF8.13DD97A5@cybersurf.net> Date: Thu, 11 Feb 1999 01:59:37 -0700 From: Brendan Rempel Organization: Cybersurf Interactive Media Inc. X-Mailer: Mozilla 4.5 [en]C-CCK-MCD (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-interfaces@postgreSQL.org Subject: Re: [INTERFACES] libpq and multi-threading on Linux? References: <19990210192449.27323.rocketmail@send105.yahoomail.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit I succeeded in doing exactly that. I simply took the C source examples on the Postgres documentation and pasted it into the thread with no problems at all. The only changes made to the examples were just simple ones like return values or fprintf(stderr) stuff, but that's all. Postgres server and libpq libraries run flawlessly in pthreads. For me, synchronization was not required since each thread did not share resources with other threads. Each thread personally initialized the libpq connection, did its job and destroyed the connection, just like the example. Brendan 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. > > thanks, > --Michael > > _________________________________________________________ > DO YOU YAHOO!? > Get your free @yahoo.com address at http://mail.yahoo.com