Re: Thread configure flag

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: shridhar_daithankar(at)persistent(dot)co(dot)in, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Thread configure flag
Date: 2003-06-21 19:57:54
Message-ID: 200306211957.h5LJvsn01077@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Peter Eisentraut wrote:
> Bruce Momjian writes:
>
> > First, ecpg has actual thead creation function calls, so I believe we
> > will still need a --with-threads configure option, at least to control
> > ecpg, unless we make threading some kind of ecpg runtime flag.
>
> This is not an issue because it only affects the libecpg library.

So we would just have a libecpg and a libecpg_r? OK.

> > So, if we move in the libpq_r direction, we will have some platforms
> > that don't have libpq_r because they don't need it, and others that
> > don't have it because they don't support threading or we don't know how
> > to do threading in our configure tests. This seems very confusing to
> > me.
>
> On a system with a separate libc_r, you *already* need special compiler
> flags to link thread-safe applications. So it is only consistent that
> libpq applications also need special flags. For example, a normal
> application is linked so:
>
> cc -o prog prog1.o prog2.o -lpq -lc
>
> (well, you don't write the -lc) and a thread-safe application is linked
> so:
>
> cc -o prog prog1.o prog2.o -lpq_r -lc_r

OK, I am now wondering if we should just create non-thread libpq by
default, and create threaded libpq for non-libc_r platforms and libpq
and libpq_r for libc_r platforms, and of course fail on platforms where
we don't know how to do threading. How is that?

> > I wonder if we should just keep the current setup for 7.4 and
> > collect theading configure information, then revisit this for 7.5.
>
> Well, when the packagers wrap up 7.4 they're going to need to make a call.
> Either it's not going to be thread-safe, and the work was in vain, or it's
> thread-safe and the concerns about the supposed performance hits are not
> addressed.

Well, it will not be in vain because people can still compile their own
builds. I am not sure if we support enough platforms to enable all this
by default in 7.4, and it could cause confusion.

--
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

Browse pgsql-patches by date

  From Date Subject
Next Message Larry Rosenman 2003-06-21 20:14:08 Re: Thread configure flag
Previous Message Dennis Björklund 2003-06-21 15:26:42 Patch for psql to avoid altering the PGresult strings