Re: getaddrinfo() for threading instead of gethostbyname()

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: "Nigel J(dot) Andrews" <nandrews(at)investsystems(dot)co(dot)uk>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: getaddrinfo() for threading instead of gethostbyname()
Date: 2003-09-27 21:48:03
Message-ID: 200309272148.h8RLm3e14670@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Thanks. That's what I needed. Yes, I left the stuff enabled becuase
the new test is pretty much the same as the old one, but some OS's might
pass the tests if they only failed on gethostbyname().

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

Nigel J. Andrews wrote:
> On Sat, 27 Sep 2003, Bruce Momjian wrote:
>
> >
> > OK, the thread test program is read for platform testing,
> > src/tools/thread_test. You will find the README, Makefile tests, and
> > program output to be very clear and almost error-proof.
> >
> > Please run it on platforms we support and report back. Thanks.
>
> Debian linux
> kernel 2.2.x (- which was 2.0 or 2.2 of debian I think, can't remember)
> glibc 2.1.3
> gcc 2.95.2
> it looks like the thread stuff is enabled in ports/linux in cvs tip
>
> hmmmm...
>
> software(at)ponder:~/database/postgres/pgsql/src/tools/thread$ make
> gcc -O2 -g -Wall -Wmissing-prototypes -Wmissing-declarations -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS -I../../../src/include -D_GNU_SOURCE -c -o thread_test.o thread_test.c
> gcc -O2 -g -Wall -Wmissing-prototypes -Wmissing-declarations -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS -L../../../src/port -Wl,-rpath,/usr/local/stow/postgresql-7.3.4/lib -lpthread thread_test.o -lpam -lz -lreadline -lcrypt -lresolv -lnsl -ldl -lm -lpgport -o thread_test
> software(at)ponder:~/database/postgres/pgsql/src/tools/thread$ ./thread_test
> Make sure you have added any needed 'THREAD_CPPFLAGS' and 'THREAD_LIBS'
> defines to your template/$port file before compiling this program.
>
> Your gethostbyname() is _not_ thread-safe
> Your getpwuid() is _not_ thread-safe
> Not all non-*_r functions are thread-safe.
> Add this to your template/$port file:
>
> NEED_REENTRANT_FUNCS=yes
> software(at)ponder:~/database/postgres/pgsql/src/tools/thread$
>
>
> Nigel
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>

--
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

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2003-09-27 21:49:32 Re: [GENERAL] pgindented tsearch2 for 7.3.4
Previous Message Bruce Momjian 2003-09-27 21:45:58 Re: Memory buffer alignment