Re: do we EXEC_BACKEND on Mac OS X?

Поиск
Список
Период
Сортировка
Искать
От
Martijn van Oosterhout
Тема
Re: do we EXEC_BACKEND on Mac OS X?
Дата
Msg-id
20121003215159.GB24334@svana.org
Ответ на
Список
Дерево обсуждения
do we EXEC_BACKEND on Mac OS X? Alvaro Herrera <alvherre@2ndquadrant.com>
Re: do we EXEC_BACKEND on Mac OS X? Bruce Momjian <bruce@momjian.us>
Re: do we EXEC_BACKEND on Mac OS X? Tom Lane <tgl@sss.pgh.pa.us>
Re: do we EXEC_BACKEND on Mac OS X? Tom Lane <tgl@sss.pgh.pa.us>
Re: do we EXEC_BACKEND on Mac OS X? Bruce Momjian <bruce@momjian.us>
Re: do we EXEC_BACKEND on Mac OS X? Tom Lane <tgl@sss.pgh.pa.us>
Re: do we EXEC_BACKEND on Mac OS X? Bruce Momjian <bruce@momjian.us>
Re: do we EXEC_BACKEND on Mac OS X? Martijn van Oosterhout <kleptog@svana.org>
Re: do we EXEC_BACKEND on Mac OS X? Tom Lane <tgl@sss.pgh.pa.us>
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  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      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
В списке pgsql-hackers по дате отправления
От: Michael Paquier
Дата:
От: Andres Freund
Дата:
FAQ