Thread: Re: Thread-safe configuration option appears to

Re: Thread-safe configuration option appears to

From
"Dann Corbit"
Date:
> -----Original Message-----
> From: Bruce Momjian [mailto:pgman@candle.pha.pa.us]
> Sent: Wednesday, August 06, 2003 4:29 PM
> To: Peter Eisentraut
> Cc: Lee Kindness; Larry Rosenman; PostgreSQL Development
> Subject: Re: [HACKERS] Thread-safe configuration option appears to
>
>
> Peter Eisentraut wrote:
> > Bruce Momjian writes:
> >
> > > First get your own platforms enabled for the existing
> thread flag,
> > > and we can revisit this when most/all our platforms are
> supported.
> > > We want to avoid confusion of having things work for some
> platforms
> > > and not others with no way to communicate that to the users.
> >
> > Yes, let's settle on that for now (= release 7.4): Without
> > --enable-thread-safety, you get the same old; with
> > --enable-thread-safety, you get _REENTRANT (or equivalent)
> for libpq
> > and libecpg, and you get pthreads in libecpg.  Then users and
> > packagers can judge the impact on their platform for themselves.
> > While the release is out there, we can gather more data on this and
> > information for the forgotten platforms, and then for 7.5 we might
> > have something that pleases more people by default.
>
> OK.
>
> > Where I see this going, however, is three buckets: one group of
> > platforms will have near zero impact and there will be pressure to
> > enable thread safety by default (BSD/OS, Linux, UnixWare), a second
> > group of platforms where there will be an endless debate
> about which
> > is right (FreeBSD, AIX), and a third group of platforms
> that have no
> > thread-safety no matter how hard you look (mostly the old
> ones).  So
> > in the end we will either have to document "libpq is thread-safe on
> > platform A, B, and C", or we will have to keep the switch for all
> > platforms and leave it off by default.
>
> I am hoping groups 1 and 2 can be merged.  I think a good
> rule is that if libc is threadsafe, we can someday enable
> libpq to be thread-safe by default, and if there is a libc_r
> that is thread-safe, we create a libpq_r for that.  In fact,
> I thought we were going to try that for 7.4 when
> --enable-thread-safety is added to configure.
>
> Perhaps by 7.5 we can enable the above logic by default.
>
> However, I do think we will have to mention the platforms
> that aren't thread-safe some day, of course, once we enable
> thread-safe by default.

Perhaps a portable BSD licensed threading library could be included for
platforms that do not have a safe thread interface.

Is there a known list of functions with reentrancy problems?


Re: Thread-safe configuration option appears to

From
Bruce Momjian
Date:
Dann Corbit wrote:
> > Perhaps by 7.5 we can enable the above logic by default.
> > 
> > However, I do think we will have to mention the platforms 
> > that aren't thread-safe some day, of course, once we enable 
> > thread-safe by default.
> 
> Perhaps a portable BSD licensed threading library could be included for
> platforms that do not have a safe thread interface.
> 
> Is there a known list of functions with reentrancy problems?

That seems pretty heavy.  I think we could support a 3rd party thread
interface if someone wanted to write one, or perhaps it would just work
out of the box, and we could test for its existance via configure.

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


Re: Thread-safe configuration option appears to

From
Tom Lane
Date:
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Dann Corbit wrote:
>> Perhaps a portable BSD licensed threading library could be included for
>> platforms that do not have a safe thread interface.

> That seems pretty heavy.

It seems highly unlikely that you could band-aid threading over a libc
that wasn't thread safe.  In any case, it's not our problem.  People
running on such a platform are certainly not going to care whether libpq
is thread-safe or not.
        regards, tom lane


Re: Thread-safe configuration option appears to

From
Philip Yarra
Date:
On Thu, 7 Aug 2003 09:49 am, Tom Lane wrote:
> People
> running on such a platform are certainly not going to care whether libpq
> is thread-safe or not.

Precisely. If your application on that platform can't start multiple threads
of execution, it's a moot point whether the DB interface on that platform is
thread-safe. It'll never get multiple threads running through it anyway.

Regards, Philip Yarra.