Re: libpq is not thread safe - Mailing list pgsql-hackers

From Tom Lane
Subject Re: libpq is not thread safe
Date
Msg-id 1674.1241383184@sss.pgh.pa.us
Whole thread Raw
In response to libpq is not thread safe  (Zdenek Kotala <Zdenek.Kotala@Sun.COM>)
Responses Re: libpq is not thread safe  (Zdenek Kotala <Zdenek.Kotala@Sun.COM>)
List pgsql-hackers
Zdenek Kotala <Zdenek.Kotala@Sun.COM> writes:
> When postgreSQL is compiled with --thread-safe that libpq should be
> thread safe. But it is not true when somebody call fork(). The problem
> is that fork() forks only active threads and some mutex can stay locked
> by another thread. We use ssl_config mutex which is global.

fork() without exec() when there are open libpq connections is
unbelievably dangerous anyway --- you will have multiple processes
that all think they own the same database connection.  I think writing
code to deal with this for the ssl_config mutex is entirely a waste
of time.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Why isn't stats_temp_directory automatically created?
Next
From: Andrew Dunstan
Date:
Subject: Re: windows doesn't notice backend death