You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Jeff Trawick <tr...@bellsouth.net> on 2001/02/15 20:15:18 UTC

threads on FreeBSD - disable?

Threads on at least some FreeBSD releases have issues.

I almost always use the prefork MPM on my FreeBSD (3.4) box.  A few
days ago, Apache started building APR with thread support even though
we're using the prefork MPM.  That is clearly the right thing to do
*in general.*

Unfortunately, weird stuff started happening with my regression
tests on FreeBSD 3.4 at this point.  To make an extremely long story
short, under certain test conditions a file which was opened O_RDONLY
was actually O_WRONLY, as verified by fcntl(,F_GETFL,) immediately
after the open().  Turning off thread support avoided the problem.
(Note that the symptom as exhibited in the APR app was quite hard to
track down to the file not being readable.)

We've noticed other "issues" with threads on FreeBSD, such as breakage
with threads+sendfile+poll.

Greg Ames picked up some undesired behavior with Apache/prefork on
FreeBSD 4.2 in the last couple of days which went away when he added
--disable-threads to his configure invocation.

So far it seems counterproductive to build a threaded APR app on
FreeBSD.  I suggest that APR needs logic like the following:

  if FreeBSD:
    if --enable-threads specified,
      abort configure with an error message
    else
      configure without thread support

Maybe other apps work fine (so far :) ) using threaded APR on BSD?

Thoughts?  It is pretty sucky to disable thread support, but it is
even worse to present it as working and end up tracking down weird
problems caused by the way we tickle the thread library or perhaps
just the thread library itself.

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

Re: threads on FreeBSD - disable?

Posted by Jeff Trawick <tr...@bellsouth.net>.
rbb@covalent.net writes:

> > So far it seems counterproductive to build a threaded APR app on
> > FreeBSD.  I suggest that APR needs logic like the following:
> > 
> >   if FreeBSD:
> >     if --enable-threads specified,
> >       abort configure with an error message
> >     else
> >       configure without thread support

> I would suggest just putting this into hints.m4 for APR, so that we
> automagically disable threading on FreeBSD for anything before
> 4.2-STABLE.  Rumor is that 4.2-STABLE has valid thread support.
> 
> I would rather not put this in configure.in, because this is the kind of
> thing hints.m4 was designed for.

sounds cool!

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

Re: threads on FreeBSD - disable?

Posted by Greg Stein <gs...@lyra.org>.
On Thu, Feb 15, 2001 at 04:27:31PM -0500, Greg Ames wrote:
> rbb@covalent.net wrote:
> > 
> > > So far it seems counterproductive to build a threaded APR app on
> > > FreeBSD.  I suggest that APR needs logic like the following:
> > >
> > >   if FreeBSD:
> > >     if --enable-threads specified,
> > >       abort configure with an error message
> > >     else
> > >       configure without thread support
> > >
> > > Maybe other apps work fine (so far :) ) using threaded APR on BSD?
> > >
> > > Thoughts?  It is pretty sucky to disable thread support, but it is
> > > even worse to present it as working and end up tracking down weird
> > > problems caused by the way we tickle the thread library or perhaps
> > > just the thread library itself.
> > 
> > I would suggest just putting this into hints.m4 for APR, so that we
> > automagically disable threading on FreeBSD for anything before
> > 4.2-STABLE.  Rumor is that 4.2-STABLE has valid thread support.
> > 
> 
> I wouldn't put much stock into this source of rumors.  daedalus is on
> 4.2-STABLE, and it's pretty hosed when you run Apache 2.0 prefork built
> with threads enabled.

Sounds like we should just flat out disable threading on FreeBSD until
somebody can show otherwise.

In other words, disable threading for *all* FreeBSD ports, then specifically
enable revisions that are known to work.

Does this disabling apply to OpenBSD and NetBSD, too?

Note: it would also be best to have the *default* be disabled. If somebody
uses --enable-threads (explicitly), then we ought to spit a warning out, but
otherwise let them be. Maybe the person who passed --enable-threads to the
command line knows something.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

Re: threads on FreeBSD - disable?

Posted by Greg Ames <gr...@raleigh.ibm.com>.
rbb@covalent.net wrote:
> 
> > So far it seems counterproductive to build a threaded APR app on
> > FreeBSD.  I suggest that APR needs logic like the following:
> >
> >   if FreeBSD:
> >     if --enable-threads specified,
> >       abort configure with an error message
> >     else
> >       configure without thread support
> >
> > Maybe other apps work fine (so far :) ) using threaded APR on BSD?
> >
> > Thoughts?  It is pretty sucky to disable thread support, but it is
> > even worse to present it as working and end up tracking down weird
> > problems caused by the way we tickle the thread library or perhaps
> > just the thread library itself.
> 
> I would suggest just putting this into hints.m4 for APR, so that we
> automagically disable threading on FreeBSD for anything before
> 4.2-STABLE.  Rumor is that 4.2-STABLE has valid thread support.
> 

I wouldn't put much stock into this source of rumors.  daedalus is on
4.2-STABLE, and it's pretty hosed when you run Apache 2.0 prefork built
with threads enabled.

Greg

Re: threads on FreeBSD - disable?

Posted by rb...@covalent.net.
> So far it seems counterproductive to build a threaded APR app on
> FreeBSD.  I suggest that APR needs logic like the following:
> 
>   if FreeBSD:
>     if --enable-threads specified,
>       abort configure with an error message
>     else
>       configure without thread support
> 
> Maybe other apps work fine (so far :) ) using threaded APR on BSD?
> 
> Thoughts?  It is pretty sucky to disable thread support, but it is
> even worse to present it as working and end up tracking down weird
> problems caused by the way we tickle the thread library or perhaps
> just the thread library itself.

I would suggest just putting this into hints.m4 for APR, so that we
automagically disable threading on FreeBSD for anything before
4.2-STABLE.  Rumor is that 4.2-STABLE has valid thread support.

I would rather not put this in configure.in, because this is the kind of
thing hints.m4 was designed for.

Ryan

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