[Patches] configure.in patch to use POSIX threads on Solaris
Guido van Rossum
guido@python.org
Fri, 25 Feb 2000 12:49:32 -0500
> On Fri, 25 Feb 2000, Pat Knight wrote:
> >...
> > Justification.
> > Use of POSIX threads on Solaris ensures that the fork() call only runs the
> > thread that called fork() in the child. This is desirable to prevent (for
> > example) parent server or database threads running in the child. Sun's
> > -lthread library uses a traditional fork() which replicates all the
> > parent's threads in the child. I find this undesirable.
>
> +1
>
> fyi: Apache ran into this same kind of issue (I think on AIX) for Apache
> 2.0 (which is threaded). The fork() used for running CGIs caused a huge
> overhead. As a result, Apache 2.0 actually has a "CGI daemon" process that
> the main server relies on to fork/exec CGI scripts. The daemon has no
> threads to duplicate at fork() time, so the fork-efficiency is much
> better.
>
> My point is that the fork() behavior Pat mentions is quite bothersome; it
> would be nice for Python to avoid it.
Agreed. We still can't promise this on all platforms (who will write
a test program in C to determine whether fork() behaves like fork1()?)
but where we can, we should promote fork==fork1.
--Guido van Rossum (home page: http://www.python.org/~guido/)