You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Jeff Trawick <tr...@ibm.net> on 2000/02/29 03:54:40 UTC

2.0: why -D_REENTRANT on FreeBSD?

Anybody out there running 2.0 on FreeBSD?

FreeBSD has no kernel threads.  Is there any known benefit to
using libc_r and the user-space thread package, particularly
when using the prefork MPM?

There is definitely extra pathlength on blocking system calls,
and I suspect Apache is breaking some unwritten rule of the
FreeBSD 3.4 thread library, as the ap_select() done by the main 
apache process at steady state dissolves into a busy loop of 
poll+gettimeofday (so says truss).

Another problem on FreeBSD: process cleanup at termination
fails (child processes left around, SysV semaphores not
cleaned up).  I suspect that it has something to do with
broken libc_r^H^H^H^H^H^H^H^Hwhatever rule Apache has broken
w.r.t. libc_r, but I haven't gotten that far yet.
-- 
Jeff Trawick | trawick@ibm.net | PGP public key at web site:
     http://www.geocities.com/SiliconValley/Park/9289/
          Born in Roswell... married an alien...

Re: 2.0: why -D_REENTRANT on FreeBSD?

Posted by rb...@apache.org.
On Wed, 1 Mar 2000, Jeff Trawick wrote:

> >just use ./configure --disable-threads
> 
> Just to make sure I understand what you're saying...
> 
>   get fresh copy
>   cd src/lib/apr
>   autoconf
>   autoheader
>   ./configure --disable-threads
> 
> This puts "-D_REENTRANT -pthread" in CFLAGS and
> defines APR_HAS_THREADS and APR_USE_PTHREAD_SERIALIZE
> in apr/include/apr.h.
> 
> Bug or feature?

BUG!  This is not happening on Linux, AFAIK.  I'll look into it on Linux,
and fix it if it is happening.  If it is only on FreeBSD, you're on your
own, because I don't have a box.

Ryan

Come to the first official Apache Software Foundation
Conference!!!   <http://ApacheCon.Com/>

_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------


Re: 2.0: why -D_REENTRANT on FreeBSD?

Posted by Jeff Trawick <tr...@ibm.net>.
>just use ./configure --disable-threads

Just to make sure I understand what you're saying...

  get fresh copy
  cd src/lib/apr
  autoconf
  autoheader
  ./configure --disable-threads

This puts "-D_REENTRANT -pthread" in CFLAGS and
defines APR_HAS_THREADS and APR_USE_PTHREAD_SERIALIZE
in apr/include/apr.h.

Bug or feature?
-- 
Jeff Trawick | trawick@ibm.net | PGP public key at web site:
     http://www.geocities.com/SiliconValley/Park/9289/
          Born in Roswell... married an alien...

Re: 2.0: why -D_REENTRANT on FreeBSD?

Posted by rb...@apache.org.
On Wed, 1 Mar 2000, Jeff Trawick wrote:

> >With the prefork MPM, it makes no sense. But we should only be
> >bothering to check for threading CFLAGS when we use a threaded MPM
> 
> But APR doesn't need to know which MPM.  Maybe two APR libraries 
> should be built -- one for multi-threaded apps and one for single-
> threaded apps?

It is very easy to build APR without threading support, just use
./configure --disable-threads.  This should be being done if the prefork
MPM is chosen.

Ryan


Come to the first official Apache Software Foundation
Conference!!!   <http://ApacheCon.Com/>

_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------


Re: 2.0: why -D_REENTRANT on FreeBSD?

Posted by Jeff Trawick <tr...@ibm.net>.
>With the prefork MPM, it makes no sense. But we should only be
>bothering to check for threading CFLAGS when we use a threaded MPM

But APR doesn't need to know which MPM.  Maybe two APR libraries 
should be built -- one for multi-threaded apps and one for single-
threaded apps?

-- 
Jeff Trawick | trawick@ibm.net | PGP public key at web site:
     http://www.geocities.com/SiliconValley/Park/9289/
          Born in Roswell... married an alien...

Re: 2.0: why -D_REENTRANT on FreeBSD?

Posted by Manoj Kasichainula <ma...@io.com>.
On Mon, Feb 28, 2000 at 09:54:40PM -0500, Jeff Trawick wrote:
> FreeBSD has no kernel threads.  Is there any known benefit to
> using libc_r and the user-space thread package, particularly
> when using the prefork MPM?

With the prefork MPM, it makes no sense. But we should only be
bothering to check for threading CFLAGS when we use a threaded MPM.