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

Re: ECPG thread-safety

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Lee Kindness <lkindness(at)csl(dot)co(dot)uk>
Cc: Philip Yarra <philip(at)utiba(dot)com>,Michael Meskes <meskes(at)postgresql(dot)org>,pgsql-interfaces(at)postgresql(dot)org
Subject: Re: ECPG thread-safety
Date: 2003-04-23 18:15:59
Message-ID: 200304231815.h3NIFxe07882@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-interfacespgsql-patches
I have libpq thread-safe patch in my queue:

	http://momjian.postgresql.org/cgi-bin/pgpatches

Once I have a way to test thread flags for various OS's, I will apply
it.  Maybe you guys can help with that too.

---------------------------------------------------------------------------

Lee Kindness wrote:
> Philip Yarra writes:
>  > I've had a few tries at testing the ECPG threadsafe patch, but so
>  > far no luck, probably due to my own lack of experience. Can someone
>  > help me out with how to test this?
>  > 
>  > So far I have:
>  > - run configure
>  > - applied Lee's patch to the source tree for 7.3.2
>  > - edited src/Makefile.global, adding -pthread to CFLAGS and and
>  > -lpthread to LIBS
>  > - make and make install
>  > - make our own pthread'd app, linking against newly installed pgsql
>  > Then when I run our app with 3 DB threads, I can watch 2 of the threads fai=
>  > l=20
>  > to return from EXEC SQL, which is exactly the same behaviour we used to get.
>  > 
>  > Can anyone point me in the right direction? I'm building on RedHat Linux 7.=
>  > 3=20
>  > on Intel, using all standard tools for that version (except updated bison=
>  > =20
>  > from 1.35 to 1.875). So gcc 2.96, gmake 3.79.1, etc. Let me know if more=20
>  > details are required.
> 
> Even with this patch you'll still be limited by the underlying
> libpq. So for example you cannot share a connection between threads
> without implementing locking to prevent multiple access to that
> connection.
> 
> I guess the best way would be to open a named connection for EACH
> thread. This SHOULD work, but again not tested...
> 
> L.
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
> 

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073


In response to

Responses

pgsql-hackers by date

Next:From: Dennis BjörklundDate: 2003-04-23 20:20:43
Subject: Re: query optimization scenarios 17,701 times faster!!!
Previous:From: Robert DyasDate: 2003-04-23 18:04:02
Subject: query optimization scenarios 17,701 times faster!!!

pgsql-patches by date

Next:From: Philip YarraDate: 2003-04-24 00:17:15
Subject: Re: ECPG thread-safety
Previous:From: Lee KindnessDate: 2003-04-23 08:47:06
Subject: ECPG thread-safety

pgsql-interfaces by date

Next:From: Sander SteffannDate: 2003-04-23 21:17:05
Subject: Re: First draft of new FE/BE protocol spec posted for comments
Previous:From: Barry LindDate: 2003-04-23 17:54:58
Subject: Re: First draft of new FE/BE protocol spec posted for comments

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