Comments about FreeBSD threading from Apache people
Daniel Eischen
eischen at vigrid.com
Wed Nov 12 22:51:07 PST 2003
On Wed, 12 Nov 2003, Craig Rodrigues wrote:
> Hi,
>
> I compiled httpd-2.0.47 from apache.org, and compiled
> the latest APR from ports with threading (-lc_r) enabled.
> This was with a -CURRENT, cvsup'd from last week.
>
> I was able to reproduce the behavior that Justin
> Erenkrantz outlined with libc_r.
> I then added the following to /etc/libmap.conf:
>
> [/opt/home/rodrigc/httpd/bin/httpd]
> libc_r.so libkse.so
> libc_r.so.5 libkse.so.1
>
> At this point, Apache worked fine.
>
> So, I can understand from the Apache point of view
> why they don't want to enable threads by default
> in APR. This whole discussion came about because
> I maintain the APR port for FreeBSD, and recently
> tried to push some threading configury fixes
> upstream back to the APR maintainers, and they balked.
>
> I'd still like to push my APR changes upstream to them,
> but maybe with threads disabled by default on FreeBSD,
> instead of enabled by default as I had in my patch.
>
> How close are we to having libkse as the default
> threading library on FreeBSD? The ports maintainers
> define PTHREAD_LIBS to be -pthread on older FreeBSD's,
> and -lc_r on newer ( > 500016) and do not tell people
> to explicitly link to -lkse.
Supposedly, libkse will be default for archs in which
it is supported (currently i386, amd64, ia64) for
5.2-RELEASE. It is undecided whether it will be default
by means of installing an appropriate libmap.conf, or
by renaming libkse back to libpthread and changing
PTHREAD_LIBS to -lpthread (and also changing gcc -pthread
so that it links to libpthread instead of libc_r).
Port maintainers shouldn't get too concerned about
this; they should continue to rely on PTHREAD_LIBS
and PTHREAD_CFLAGS. I suppose there is the possibility
that some ports may want a specific threads library.
In that case, perhaps PTHREAD_LIBS can be overridden
by the port. But you should probably ask ports@
to see if that is how it should be handled.
--
Dan Eischen
More information about the freebsd-threads
mailing list