Re: libpq thread safety

From: Manfred Spraul <manfred(at)colorfullife(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: libpq thread safety
Date: 2004-03-14 11:15:46
Message-ID: 40543EE2.8030309@colorfullife.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Bruce Momjian wrote:

>Your patch has been added to the PostgreSQL unapplied patches list at:
>
> http://momjian.postgresql.org/cgi-bin/pgpatches
>
>I will try to apply it within the next 48 hours.
>
>
You are too fast: the patch was a proof of concept, not really tested
(actually quite buggy).
Attached are two patches:

- ready-sigpipe: check_sigpipe_handler skips pthread_create_key if a
signal handler was installed. This is wrong - the key is always required.
- ready-locking: locking around kerberos and openssl.

The patches pass the regression tests on i386 linux. Kerberos is
untested, ssl only partially tested due to the lack of a test setup.
I'm still not sure if the new code is the right thing for the openssl
initialization: libpq calls SSL_library_init() unconditionally. If the
calling app uses ssl, too, this might confuse openssl.

Could you replace my initial proposal with these two patches?

Btw, is it intentional that THREAD_SUPPORT is not set in src/template/linux?

--
Manfred

Attachment Content-Type Size
ready-locking text/plain 17.3 KB
ready-sigpipe text/plain 1.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Richard Huxton 2004-03-14 11:30:27 Re: Further thoughts about warning for costly FK checks
Previous Message Tatsuo Ishii 2004-03-14 10:31:53 Re: try to find out the checkpoint record?

Browse pgsql-patches by date

  From Date Subject
Next Message Michael Meskes 2004-03-14 12:17:01 Re: ECPG - Remove need for "AT connection" when using threads
Previous Message Claudio Natoli 2004-03-14 06:03:51 pgstat win32 fix