Re: thread_test.c problems

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Wes Palmer <Wesley(dot)R(dot)Palmer(at)syntegra(dot)com>, PostgreSQL-general <pgsql-general(at)postgresql(dot)org>, joseph speigle <joe(dot)speigle(at)jklh(dot)us>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: thread_test.c problems
Date: 2004-04-26 04:06:04
Message-ID: 200404260406.i3Q464d11124@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

> What we really want is for the configure script to _add_ to the existing
> options, and I thought that's what it did. Another bad thing it does is
> if it the supplied port options don't work, it erases them and tries it
> own.
>
> Now, the fact that the configure thread test program worked and reported
> good results means:
>
> o threads work with the supplied options
> o errno is thread-safe
>
> so I think the supplied Darwin options are enough.
>
> Interesting that the acx_pthread.m4 just keep checking options until it
> finds one that succeeds, then stops tryinug any more.
>
> I have to think about this. I think maybe we should add a
> PTHREAD_CPPFLAGS to template port files, and just add that in at the
> end.
>
> They actually have this little port-specific code:
>
> case "${host_cpu}-${host_os}" in
> *-aix* | *-freebsd*) flag="-D_THREAD_SAFE";;
> *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
> esac
>
> and I think we need to remove that and have the template files handle
> such thing.

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.

--
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 wespvp 2004-04-26 05:25:36 Re: thread_test.c problems
Previous Message tech tech 2004-04-26 03:53:39 Re: PostgreSQL 7.4.2 initdb problem

Browse pgsql-hackers by date

  From Date Subject
Next Message Dennis Bjorklund 2004-04-26 05:15:08 Re: Bringing PostgreSQL torwards the standard regarding
Previous Message Neil Conway 2004-04-26 03:50:09 Re: linked list rewrite