Re: enable thready safety on Mac OS X 10.3.4

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: wespvp(at)syntegra(dot)com
Cc: Keary Suska <hierophant(at)pcisys(dot)net>, Postgres General <pgsql-general(at)postgresql(dot)org>, Aaron Burghardt <aburgh(at)mac(dot)com>
Subject: Re: enable thready safety on Mac OS X 10.3.4
Date: 2004-07-08 16:28:50
Message-ID: 200407081628.i68GSog19058@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


OK, I have removed the changes I just added to allow threads for 7.4.X
on OSX. This stuff had to be dealt with before 7.4 final, and I don't
want to play with it at this point. 7.5 thread testing is automatic so
people will have to wait for that.

---------------------------------------------------------------------------

wespvp(at)syntegra(dot)com wrote:
> On 7/5/04 11:06 PM, "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us> wrote:
>
> > The thread testing in 7.5 is dramatically different from 7.4 and can't
> > be backpatched. What should I add to template/darwin for 7.4.4?
>
> > I added these two lines:
> >
> > THREAD_SUPPORT=yes
> > NEED_REENTRANT_FUNCS=no
>
> I don't think this is safe. What I've been using since 7.4.1/Mac OS X 10.3
> is:
>
> # Apple's cpp-precomp seems a tad broken, so don't use it
> # (Note: on OS X before 10.2, you might need -traditional-cpp instead)
> CC="$CC -no-cpp-precomp"
>
> # Select appropriate semaphore support
> USE_NAMED_POSIX_SEMAPHORES=1
>
> # tools/thread/thread_test must be run
> THREAD_SUPPORT=yes
> THREAD_CPPFLAGS="-D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS"
> THREAD_LIBS="-lpthread"
>
> NEED_REENTRANT_FUNCS=yes
>
>
> It appears with OS X 10.3.4, the THREAD_LIBS="-lpthread" is no longer
> necessary (or is it due to PostgreSQL 7.3.4?). Previously it would not
> build without this. With 7.3.4 and OS X 10.3.4, it will build with or
> without it. I think -lpthread was required with OS X 10.2 (Jaguar).
>
> I don't recall why -D_POSIX_PTHREAD_SEMANTICS was needed.
>
> If I run thread_test many times, I get inconsistent results. I get both:
>
> All your non-*_r functions are thread-safe.
> Add this to your template/$port file:
>
> NEED_REENTRANT_FUNCS=no
>
> and:
>
> Your gethostbyname() is _not_ thread-safe
> Not all non-*_r functions are thread-safe.
> Add this to your template/$port file:
>
> NEED_REENTRANT_FUNCS=yes
>
> Thus, to be safe I believe 'NEED_REENTRANT_FUNCS=yes' should be specified.
> If I remember right from earlier discussions, the '-D_REENTRANT' *is*
> required to insure errno is handled properly in a threaded environment.
>
> See also the thread 'thread_test.c problems' back in of April. This was the
> last entry from you on the subject:
>
> > OK, CVS is ready. I unconditionally defined:
> >
> > -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS
> >
> > for all ports. It can't hurt if they are not supported, but it makes
> > our job easier for porting. It allowed me to remove almost all the
> > port-specific thread stuff. The other tests are done by configure and
> > thread_test.
> >
> > Should fix Darwin compile and other platforms without mucking with the
> > thread detection code.
>
>
> Wes
>

--
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-general by date

  From Date Subject
Next Message Robert Treat 2004-07-08 16:39:56 Re: Column name 'user' not allowed?
Previous Message gearond 2004-07-08 16:19:36 Re: Column name 'user' not allowed?