Skip site navigation (1) Skip section navigation (2)

Re: do we EXEC_BACKEND on Mac OS X?

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>,Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: do we EXEC_BACKEND on Mac OS X?
Date: 2012-10-03 21:52:00
Message-ID: 20121003215159.GB24334@svana.org (view raw or flat)
Thread:
Lists: pgsql-hackers
On Wed, Oct 03, 2012 at 01:57:47PM -0400, Bruce Momjian wrote:
> On Wed, Oct  3, 2012 at 01:53:28PM -0400, Tom Lane wrote:
> > Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > > Yes, but those framework libraries are typically supposed to prevent
> > > such problems from being seen by applications calling them.
> > 
> > How exactly would a library prevent such problems?  In particular,
> > let's see a proposal for how libpq might make it look like a fork
> > was transparent for an open connection.
> 
> I guess that is impossible.

Well, not quite impossible. A simple solution would be to use
pthread_atfork() to register a handler that puts the socket into an
invalid state in either the parent or the child.

http://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_atfork.html

Ofcourse, the backward compatabilty issues prevent us doing that, but
it's *possible*.

Have a nice day,
-- 
Martijn van Oosterhout   <kleptog(at)svana(dot)org>   http://svana.org/kleptog/
> He who writes carelessly confesses thereby at the very outset that he does
> not attach much importance to his own thoughts.
   -- Arthur Schopenhauer

In response to

Responses

pgsql-hackers by date

Next:From: Andres FreundDate: 2012-10-03 21:53:52
Subject: Re: Support for REINDEX CONCURRENTLY
Previous:From: Michael PaquierDate: 2012-10-03 21:42:25
Subject: Re: Support for REINDEX CONCURRENTLY

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group