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

Re: PostgreSQL libraries - PThread Support, but not use...

From: Lee Kindness <lkindness(at)csl(dot)co(dot)uk>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>,Lee Kindness <lkindness(at)csl(dot)co(dot)uk>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: PostgreSQL libraries - PThread Support, but not use...
Date: 2003-01-07 11:20:32
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackerspgsql-patches
Tom Lane writes:
 > Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
 > > We have definatly had requests for improved thread-safeness for libpq
 > > and ecpg in the past, so whatever you can do would be a help.  We say
 > > libpq is thread-safe, but specifically mention the non-threadsafe calls
 > > in the libpq documentation, or at least we should.
 > We do:
 > But Lee's point about depending on possibly-unsafe libc routines is a
 > good one.  I don't think anyone's gone through the code with an eye to
 > that.

Right, so a reasonable angle for me to take is to go through the libpq
source looking for potential problem areas and use of "known bad"
functions. I can add autoconf checks for the replacement *_r()
functions, and use these in place of the traditional ones where

If any function is found to be not thread-safe and cannot be made so
using standard library calls then it needs to be documented as such
both in the source and the aforementioned documentation.

This approach avoids any thread library dependencies and documents the
current state of play WRT thread safety (i.e it's a good, and needed,
basis for any later work).

ECPG is a separate issue, and best handled as such (it will need
thread calls). I'll post a patch for it at a later date so the changes
are available to anyone who wants to play with ECPG and threads.

Ta, Lee.

In response to


pgsql-hackers by date

Next:From: Dan LangilleDate: 2003-01-07 11:44:25
Subject: Re: [HACKERS] Have people taken a look at pgdiff yet?
Previous:From: Manfred KoizarDate: 2003-01-07 10:39:58
Subject: Re: Upgrading rant.

pgsql-patches by date

Next:From: Ron PetersonDate: 2003-01-07 14:54:22
Subject: insert rule doesn't see id field
Previous:From: Manfred KoizarDate: 2003-01-07 10:31:46
Subject: Small stylistic change

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