You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by j_...@hushmail.com on 2001/04/01 14:15:52 UTC

APR threads and FreeBSD

Could someone please tell me why APR_HAS_THREADS is false on FreeBSD?  I 
have written pthreads based code on FreeBSD and Linux and they both seem 
to work well (I only have 1 cpu, so FreeBSDs limitation that each process 
runs on only 1 cpu at a time doesn't effect me).  When configuring with 
--enable-threads APR compiles (however the rest of Apache will not), and 
the testthread test passes just fine, but the testsock test seems to fail. 
 Without the --enable-threads APR compiles and the testsock works normally,
 of course testthread fails in this case with the predictable message "This 
program won't work on this platform because there is no support for threads".

I am currently running FreeBSD 4.2.

Thanks,
Jesse
Free, encrypted, secure Web-based email at www.hushmail.com

Re: APR threads and FreeBSD

Posted by Jeff Trawick <tr...@bellsouth.net>.
j_burns@hushmail.com writes:

> Could someone please tell me why APR_HAS_THREADS is false on FreeBSD?  I 
> have written pthreads based code on FreeBSD and Linux and they both seem 
> to work well (I only have 1 cpu, so FreeBSDs limitation that each process 
> runs on only 1 cpu at a time doesn't effect me).  When configuring with 
> --enable-threads APR compiles (however the rest of Apache will not), and 
> the testthread test passes just fine, but the testsock test seems to fail. 
>  Without the --enable-threads APR compiles and the testsock works normally,
>  of course testthread fails in this case with the predictable message "This 
> program won't work on this platform because there is no support for
> threads".

What is the compile failure in Apache when you add --enable-threads?
I don't think a compile failure is expected.

Your observation about testsock illustrates some of the problems we've
had with threads on FreeBSD.  Neither testsock nor the programs it
starts use threads, but you observed that building with thread support
(linking with libc_r) broke it.  Compiling APR + prefork MPM with
thread support results in weird breakage and looping in libc_r.  No
threads were ever created.

All I can say is that neither our threaded apps nor our unthreaded
apps work properly when thread support is enabled on FreeBSD.  I wish
I had time/skills/gumption to resolve the problem, but alas that is
not the case.  For now, folks are better off with threads disabled on
FreeBSD.  Of course we'd be thrilled if some of the FreeBSD thread
folks would use --enable-threads and see what is happening :)

-- 
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: APR threads and FreeBSD

Posted by rb...@covalent.net.
Threads do not work well on FreeBSD, any version that we have tested.  We
had serious problems with threads and sendfile on FreeBSD 4.2, and some
unexplainable looping that went away when we removed the threads.  The
reason testsock fails with threads, is that sendfile is completely
unpredicatable on FreeBSD with threads.  A full description of what we saw
when enabled threads on FreeBSD can be found in the development archives
sometime in January.

Ryan

On Sun, 1 Apr 2001 j_burns@hushmail.com wrote:

> Could someone please tell me why APR_HAS_THREADS is false on FreeBSD?  I
> have written pthreads based code on FreeBSD and Linux and they both seem
> to work well (I only have 1 cpu, so FreeBSDs limitation that each process
> runs on only 1 cpu at a time doesn't effect me).  When configuring with
> --enable-threads APR compiles (however the rest of Apache will not), and
> the testthread test passes just fine, but the testsock test seems to fail.
>  Without the --enable-threads APR compiles and the testsock works normally,
>  of course testthread fails in this case with the predictable message "This
> program won't work on this platform because there is no support for threads".
>
> I am currently running FreeBSD 4.2.
>
> Thanks,
> Jesse
> Free, encrypted, secure Web-based email at www.hushmail.com


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