Re: [HACKERS] PostgreSQL libraries - PThread Support, but

From: Lee Kindness <lkindness(at)csl(dot)co(dot)uk>
To: pgsql-patches(at)postgresql(dot)org
Cc: Lee Kindness <lkindness(at)csl(dot)co(dot)uk>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Subject: Re: [HACKERS] PostgreSQL libraries - PThread Support, but
Date: 2003-01-13 12:31:44
Message-ID: 15906.45488.371123.926993@kelvin.csl.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Patch attached, along with new libpq-reentrant.c and libpq-reentrant.h
files for src/interfaces/libpq.

Also at http://services.csl.co.uk/postgresql/

Thanks, Lee.

Lee Kindness writes:
> Ok guys, I propose that the new libpq diff and 2 source files which
> i'll soon send to pgsql-patches is applied to the source. This diff is
> a cleaned up version of the previous version with the wrapper
> functions moved out into their own file and more comments added. Also
> the use of crypt_r() has been removed (not worth the effort), the
> cpp defines have been renamed to be consistent with each other and
> Tom's concerns with loose #defines has been partly addressed.
>
> This diff does not include any configure changes. I plan to tackle
> this separately ASAP, and hopefully produce something more acceptable.
>
> I will add checks for appropriate compiler thread flags (for compiling
> libpq, and alow the removal of #defines in libpq-reentrant.h), and
> link flags & libs (for a planned threaded libpq test program and
> renentrant ecpg library). If a thread environment is found then check
> for the reentrant functions will be done.
>
> Looking at various open source projects configure.in files there seems
> to be little commonality in the thread test macros (telp gratefully
> accepted!), I currently think that something like the approach used by
> glib is most suitable (switch on OS).
>
> All sound acceptable?
>
> Thanks, Lee.
>
> Peter Eisentraut writes:
> > Lee Kindness writes:
> >
> > > Patches attached to make libpq thread-safe, now uses strerror_r(),
> > > gethostbyname_r(), getpwuid_r() and crypt_r() where available. Where
> > > strtok() was previously used strchr() is now used.
> >
> > AC_TRY_RUN tests are prohibited. Also, try to factor out some of these
> > huge tests into separate macros and put them into config/c-library.m4.
> > And it would be nice if there was some documentation about what was
> > checked for. If you just want to check whether gethostbyname_r() has 5 or
> > 6 arguments you can do that in half the space.

Attachment Content-Type Size
libpq_r-diffs-20030113.txt text/plain 30.8 KB
libpq-reentrant.h text/plain 1.6 KB
libpq-reentrant.c text/plain 2.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message greg 2003-01-13 14:20:07 Re: PostgreSQL site, put up or shut up?
Previous Message Lee Kindness 2003-01-13 12:20:40 Re: [PATCHES] PostgreSQL libraries - PThread Support, but

Browse pgsql-patches by date

  From Date Subject
Next Message Neil Conway 2003-01-13 18:42:54 fix broken regression tests
Previous Message Lee Kindness 2003-01-13 12:20:40 Re: [PATCHES] PostgreSQL libraries - PThread Support, but