Re: [INTERFACES] Re: Adding a Search Link ... (fwd)

Lists: pgsql-interfaces
From: The Hermit Hacker <scrappy(at)hub(dot)org>
To: pgsql-interfaces(at)postgresql(dot)org
Cc: vev(at)hub(dot)org, Alexander Barkov <bar(at)izhcom(dot)ru>
Subject: Re: Adding a Search Link ... (fwd)
Date: 2000-01-06 18:09:54
Message-ID: Pine.BSF.4.21.0001061408400.18498-100000@thelab.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-interfaces


Erk...I know *someone* was working on this...did we ever get anywhere on a
thread-safe libpq?

Marc G. Fournier ICQ#7615664 IRC Nick: Scrappy
Systems Administrator @ hub.org
primary: scrappy(at)hub(dot)org secondary: scrappy(at){freebsd|postgresql}.org

---------- Forwarded message ----------
Date: Thu, 06 Jan 2000 22:02:14 +0400
From: Alexander Barkov <bar(at)izhcom(dot)ru>
To: The Hermit Hacker <scrappy(at)hub(dot)org>
Subject: Re: Adding a Search Link ...

Hi again! I just have run to the shop to by some beer :-)
It is 10 PM here.

The Hermit Hacker wrote:
>
> that appears to do it...
>
> now, how to enable the threading? :)
>
> I added:
>
> #define HAVE_PTHREAD 1
>
> to config.h
>

Don't edit config.h!

Just set up the environment variable CFLAGS with value "-pthread
-DHAVE_PTHREAD"

Then open main.c at line 238:

for(i=0;i<1;i++){

It is currently one thread, we did not implement yet a command line key
to set up
how many threads to start. Just write 2,3,4 for example. But I do not
currently
remember is libpq thread safe or not. I know definitly that mysql is
thread safe.

Then run configure and make.

--
Alexander Barkov
IZHCOM, Izhevsk
email: bar(at)izhcom(dot)ru | http://www.izhcom.ru
Phone: +7 (3412) 51-55-45 | Fax: +7 (3412) 78-70-10
ICQ: 7748759


From: Lamar Owen <lamar(dot)owen(at)wgcr(dot)org>
To: The Hermit Hacker <scrappy(at)hub(dot)org>
Cc: pgsql-interfaces(at)postgresql(dot)org, vev(at)hub(dot)org, Alexander Barkov <bar(at)izhcom(dot)ru>
Subject: Re: [INTERFACES] Re: Adding a Search Link ... (fwd)
Date: 2000-01-06 18:41:01
Message-ID: 3874E1BD.D7440BBB@wgcr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-interfaces

The Hermit Hacker wrote:
>
> Erk...I know *someone* was working on this...did we ever get anywhere on a
> thread-safe libpq?

Well, I don't think it has been fully documented, but the current libpq,
as long as you don't use one connect method, and use another --
apparently PQsetdbLogin IS threadsafe, as the AOLserver driver uses that
successfully. I THINK (I would search the archives, but.... Don Baccus
posted a question about just that at one point, and it was answered)
PQconnectdb is not, but don't quote me on that.

The short of it is that AOLserver, a multithreaded webserver,
successfully uses PQsetdbLogin -- which is apparently thread-safe.

Once the connection is established, libpq is apparently thread-safe. (at
least it is operating under a multithreaded webserver....)

--
Lamar Owen
WGCR Internet radio
1 Peter 4:11