threading and FreeBSD

Started by Bruce Momjianover 22 years ago4 messageshackers
Jump to latest
#1Bruce Momjian
bruce@momjian.us

Our current template/freebsd has:

CFLAGS='-pipe'

case $host_cpu in
alpha*) CFLAGS="$CFLAGS -O" ;;
esac

SUPPORTS_THREADS=yes
case $host_os in
freebsd2*|freebsd3*|freebsd4*)
THREAD_CFLAGS="-pthread"
NEED_REENTRANT_FUNC_NAMES=yes
;;
*)
THREAD_LIBS="-lc_r"
NEED_REENTRANT_FUNC_NAMES=yes
;;
esac

Now, this says FreeBSD needs reentrant named functions for all versions.

However, our main server (4.8-STABLE FreeBSD) doesn't have any mention
of getpwuid_r(). Would some FreeBSD folks test the
--enable-thread-safey and let us know how things work?

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#2Christopher Kings-Lynne
chriskl@familyhealth.com.au
In reply to: Bruce Momjian (#1)
Re: threading and FreeBSD

I've been doing all my freebsd/alpha build with --enable-thread-safety for
weeks and I haven't seen any compile or running problems...

Configure doesn't see it tho:

checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking for strerror_r... yes
checking for getpwuid_r... no
checking for gethostbyname_r... no

Chris

----- Original Message -----
From: "Bruce Momjian" <pgman@candle.pha.pa.us>
To: "PostgreSQL-development" <pgsql-hackers@postgresql.org>
Sent: Friday, August 15, 2003 6:43 AM
Subject: [HACKERS] threading and FreeBSD

Our current template/freebsd has:

CFLAGS='-pipe'

case $host_cpu in
alpha*) CFLAGS="$CFLAGS -O" ;;
esac

SUPPORTS_THREADS=yes
case $host_os in
freebsd2*|freebsd3*|freebsd4*)
THREAD_CFLAGS="-pthread"
NEED_REENTRANT_FUNC_NAMES=yes
;;
*)
THREAD_LIBS="-lc_r"
NEED_REENTRANT_FUNC_NAMES=yes
;;
esac

Now, this says FreeBSD needs reentrant named functions for all versions.

However, our main server (4.8-STABLE FreeBSD) doesn't have any mention
of getpwuid_r(). Would some FreeBSD folks test the
--enable-thread-safey and let us know how things work?

-- 
Bruce Momjian                        |  http://candle.pha.pa.us
pgman@candle.pha.pa.us               |  (610) 359-1001
+  If your life is a hard drive,     |  13 Roberts Road
+  Christ can be your backup.        |  Newtown Square, Pennsylvania

19073

Show quoted text

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

#3Philip Yarra
philip@utiba.com
In reply to: Christopher Kings-Lynne (#2)
Re: threading and FreeBSD

Something odd going on with the list - I never saw the original that Chris is
replying to.

Philip.

Show quoted text

On Fri, 15 Aug 2003 12:22 pm, Christopher Kings-Lynne wrote:

I've been doing all my freebsd/alpha build with --enable-thread-safety for
weeks and I haven't seen any compile or running problems...

Configure doesn't see it tho:

checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking for strerror_r... yes
checking for getpwuid_r... no
checking for gethostbyname_r... no

Chris

----- Original Message -----
From: "Bruce Momjian" <pgman@candle.pha.pa.us>
To: "PostgreSQL-development" <pgsql-hackers@postgresql.org>
Sent: Friday, August 15, 2003 6:43 AM
Subject: [HACKERS] threading and FreeBSD

Our current template/freebsd has:

CFLAGS='-pipe'

case $host_cpu in
alpha*) CFLAGS="$CFLAGS -O" ;;
esac

SUPPORTS_THREADS=yes
case $host_os in
freebsd2*|freebsd3*|freebsd4*)
THREAD_CFLAGS="-pthread"
NEED_REENTRANT_FUNC_NAMES=yes
;;
*)
THREAD_LIBS="-lc_r"
NEED_REENTRANT_FUNC_NAMES=yes
;;
esac

Now, this says FreeBSD needs reentrant named functions for all versions.

However, our main server (4.8-STABLE FreeBSD) doesn't have any mention
of getpwuid_r(). Would some FreeBSD folks test the
--enable-thread-safey and let us know how things work?

--
Bruce Momjian                        |  http://candle.pha.pa.us
pgman@candle.pha.pa.us               |  (610) 359-1001
+  If your life is a hard drive,     |  13 Roberts Road
+  Christ can be your backup.        |  Newtown Square, Pennsylvania

19073

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

#4Bruce Momjian
bruce@momjian.us
In reply to: Christopher Kings-Lynne (#2)
Re: threading and FreeBSD

I have applied a patch to have NEED_REENTRANT_FUNC_NAMES _require_ the
*_r libraries, rather than the old behavior of just using the *_r
libraries if they exist. With my new research documented in thread.c, I
think this is the proper way to handle it.

I have also marked FreeBSD as not requiring NEED_REENTRANT_FUNC_NAMES
anymore. I think it uses libc_r or -pthread compile flag rather than
the *_r names.

I need other platforms to test this change because platforms marked as
NEED_REENTRANT_FUNC_NAMES will _need_ those *_r functions to exist for
threading.

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

Christopher Kings-Lynne wrote:

I've been doing all my freebsd/alpha build with --enable-thread-safety for
weeks and I haven't seen any compile or running problems...

Configure doesn't see it tho:

checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking for strerror_r... yes
checking for getpwuid_r... no
checking for gethostbyname_r... no

Chris

----- Original Message -----
From: "Bruce Momjian" <pgman@candle.pha.pa.us>
To: "PostgreSQL-development" <pgsql-hackers@postgresql.org>
Sent: Friday, August 15, 2003 6:43 AM
Subject: [HACKERS] threading and FreeBSD

Our current template/freebsd has:

CFLAGS='-pipe'

case $host_cpu in
alpha*) CFLAGS="$CFLAGS -O" ;;
esac

SUPPORTS_THREADS=yes
case $host_os in
freebsd2*|freebsd3*|freebsd4*)
THREAD_CFLAGS="-pthread"
NEED_REENTRANT_FUNC_NAMES=yes
;;
*)
THREAD_LIBS="-lc_r"
NEED_REENTRANT_FUNC_NAMES=yes
;;
esac

Now, this says FreeBSD needs reentrant named functions for all versions.

However, our main server (4.8-STABLE FreeBSD) doesn't have any mention
of getpwuid_r(). Would some FreeBSD folks test the
--enable-thread-safey and let us know how things work?

-- 
Bruce Momjian                        |  http://candle.pha.pa.us
pgman@candle.pha.pa.us               |  (610) 359-1001
+  If your life is a hard drive,     |  13 Roberts Road
+  Christ can be your backup.        |  Newtown Square, Pennsylvania

19073

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Attachments:

/bjm/difftext/plainDownload+206-111