Re: Thread configure flag - Mailing list pgsql-patches

From Tom Lane
Subject Re: Thread configure flag
Date
Msg-id 6399.1055794241@sss.pgh.pa.us
Whole thread Raw
In response to Re: Thread configure flag  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: Thread configure flag  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-patches
Peter Eisentraut <peter_e@gmx.net> writes:
> Bruce Momjian writes:
>> If it is the default, libpq is going to use the libc_r library, at least
>> on some platforms, and that may not be desired.

> But what is the objective reason for this lack of desire?

I have heard that the reentrant libc is significantly worse-performing
than the non-reentrant one on some platforms.  This is not real hard
to believe, since functions as common as malloc() will need locking
overhead if they think they might be in a multithreaded environment.

However, that's only an argument that we must provide a
--without-threads option, it doesn't speak strongly to the question of
what the default choice should be (where there is a choice).


> _POSIX_PTHREAD_SEMANTICS isn't used anywhere in the entire system, the
> effect of _THREAD_SAFE is to define _REENTRANT, and the effect of
> _REENTRANT is to declare getlogin_r(), which PostgreSQL sources don't use.

On which version of Linux are the above statements true?  Are you sure
they are true on other versions?

            regards, tom lane

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Thread configure flag
Next
From: Josh Berkus
Date:
Subject: Runtime.sgml patch