Re: UnixWare/CVS Tip/initdb.c needs to use threads

From: Larry Rosenman <ler(at)lerctr(dot)org>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: UnixWare/CVS Tip/initdb.c needs to use threads
Date: 2004-03-19 05:03:40
Message-ID: 77090000.1079672620@lerlaptop.lerctr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

--On Thursday, March 18, 2004 22:47:39 -0600 Larry Rosenman
<ler(at)lerctr(dot)org> wrote:

>
>
> --On Thursday, March 18, 2004 23:03:16 -0500 Bruce Momjian
> <pgman(at)candle(dot)pha(dot)pa(dot)us> wrote:
>

>> I see that initdb is just the first of many /bin programs to be
>> compiled, so if we have to add the thread lib, we will have to do it for
>> all the bin programs. Yikes. Why wasn't this a problem for 7.4?
> 7.4 had initdb as a Shell Script.
> the 7.4.x libpq didn't have any pthread_* references in it, that I see
> on my box.

more info:

/home/ler/pg-prod/postgresql-7.4.2/src/interfaces/libpq:

$ grep pthread_ *.c
thread.c: * strerror(). Other operating systems use
pthread_setspecific()
thread.c: * and pthread_getspecific() internally to allow standard
library
thread.c: * use pthread_setspecific/pthread_getspecific() also have *_r
versions
thread.c: * getpwuid() calls pthread_setspecific/pthread_getspecific()
to return
thread.c: static pthread_mutex_t strerror_lock =
PTHREAD_MUTEX_INITIALIZER;
thread.c: pthread_mutex_lock(&strerror_lock);
thread.c: pthread_mutex_unlock(&strerror_lock);
thread.c: static pthread_mutex_t getpwuid_lock =
PTHREAD_MUTEX_INITIALIZER;
thread.c: pthread_mutex_lock(&getpwuid_lock);
thread.c: pthread_mutex_unlock(&getpwuid_lock);
thread.c: static pthread_mutex_t gethostbyname_lock =
PTHREAD_MUTEX_INITIALIZER;
thread.c: pthread_mutex_lock(&gethostbyname_lock);
thread.c: pthread_mutex_unlock(&gethostbyname_lock);
$ nm libpq.so | grep pthread
$

/home/ler/pg-dev/pgsql-server/src/interfaces/libpq: (7.5-dev):

$ nm libpq.so | grep pthread_
[271] |0 |0 |NOTY |GLOB |0 |UNDEF
|pthread_getspecific
[370] |0 |0 |NOTY |GLOB |0 |UNDEF
|pthread_key_create
[421] |0 |0 |NOTY |GLOB |0 |UNDEF |pthread_once
[434] |0 |0 |NOTY |GLOB |0 |UNDEF
|pthread_setspecific
$ grep pthread_ *.c
fe-connect.c: static pthread_once_t check_sigpipe_once =
PTHREAD_ONCE_INIT;
fe-connect.c: pthread_once(&check_sigpipe_once, check_sigpipe_handler);
fe-print.c:
pthread_setspecific(thread_in_send, "t");
fe-print.c: pthread_setspecific(thread_in_send, "f");
fe-secure.c:pthread_key_t thread_in_send;
fe-secure.c: pthread_setspecific(thread_in_send, "t");
fe-secure.c: pthread_setspecific(thread_in_send, "f");
fe-secure.c: pthread_key_create(&thread_in_send, NULL);
fe-secure.c: return (pthread_getspecific(thread_in_send) /* has it been
set? */ &&
fe-secure.c: *(char
*)pthread_getspecific(thread_in_send) == 't') ? true : false;
thread.c: * strerror(). Other operating systems use
pthread_setspecific()
thread.c: * and pthread_getspecific() internally to allow standard
library
thread.c: * use pthread_setspecific/pthread_getspecific() also have *_r
versions
thread.c: * getpwuid() calls pthread_setspecific/pthread_getspecific()
to return
$
--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 972-414-9812 E-Mail: ler(at)lerctr(dot)org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Kings-Lynne 2004-03-19 05:26:10 SET WITHOUT CLUSTER patch
Previous Message Joseph Shraibman 2004-03-19 04:49:21 Re: Will auto-cluster be in 7.5?

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2004-03-19 13:01:53 Re: UnixWare/CVS Tip/initdb.c needs to use threads flags...
Previous Message Robert Treat 2004-03-19 04:50:04 FAQ updates