Re: libpq_r - Mailing list pgsql-hackers

From Larry Rosenman
Subject Re: libpq_r
Date
Msg-id 2980000.1059126476@lerlaptop.lerctr.org
Whole thread Raw
In response to Re: libpq_r  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers

--On Friday, July 25, 2003 11:51:50 +0200 Peter Eisentraut 
<peter_e@gmx.net> wrote:

> Larry Rosenman writes:
>
>> The -D_REENTRANT causes NO pain, and makes it possible to have ONE
>> library for UnixWare.
>
> Didn't you just say that -D_REENTRANT changes the definition of errno on
> your system?  Surely it would not be a good idea to link a libpq that uses
> variant 1 with a program that uses variant 2.  Maybe I'm wrong and you can
> do that, but it sounds problematic to me.
Yes, it DOES change errno, but it is **NOT** problematic.  the static int 
is there
ONLY FOR THE FIRST LWP (thread) of a process.  The reentrant version 
accesses the same
information for ANY LWP.  the first LWP can also use it for getting access.

It is SAFER to use the reentrant version, so that if a THREADED program 
uses libpq,
we are now thread-safe.

LER




-- 
Larry Rosenman                     http://www.lerctr.org/~ler
Phone: +1 972-414-9812                 E-Mail: ler@lerctr.org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: libpq_r
Next
From: Andrew Sullivan
Date:
Subject: Re: php with postgres