Re: do we EXEC_BACKEND on Mac OS X?

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: do we EXEC_BACKEND on Mac OS X?
Date: 2012-10-03 16:15:35
Message-ID: 20121003161535.GB3470@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Oct 3, 2012 at 01:05:54PM -0300, Alvaro Herrera wrote:
> See the CAVEATS here:
>
> https://developer.apple.com/library/mac/#documentation/Darwin/Referenc
> e/ManPages/man2/fork.2.html
>
> Apparently fork() without exec() isn't all that well supported.
>
> Noticed while perusing http://lwn.net/Articles/518306/

I think this comment is more relevant:

Ah, OK, I found this

https://developer.apple.com/library/mac/#documentation/Da...

It seems that from 10.5 this caveat was added to the official OS
X documentation. In that light I think it's safest to conclude
that Apple realised fork() is hard (check out the long list
of things a current Linux fork does to retain sanity in the
face of threads, asynchronous I/O, capabilities and other fun
toys that didn't exist at the dawn of Unix) and decided they
don't care. It will probably work, but if it doesn't they aren't
interested in explaining why/ fixing the problem.

On balance I agree this makes OS X a pretty shoddy Unix, but
then, I would have been easily persuaded of that anyway.

I am hesitant to avoid fork() on OS/X until someone reports a problem;
the slowdown would be significant, and I don't think we use enough OS/X
libraries to cause a problem for us, though Bonjour might be a problem.

Anyway, good you asked and we should be aware of possible problems.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Boszormenyi Zoltan 2012-10-03 16:15:58 Re: [PATCH] Make pg_basebackup configure and start standby [Review]
Previous Message Alvaro Herrera 2012-10-03 16:07:38 Re: CREATE SCHEMA IF NOT EXISTS