[mod_python] threads and FreeBSD: LD_PRELOAD=/usr/lib/libc_r.so the same as --enable-threads?

Graham Dumpleton grahamd at dscpl.com.au
Fri Sep 1 21:17:35 EDT 2006

On 02/09/2006, at 7:17 AM, Chad Whitacre wrote:

> Grisha's answer is to "cause Apache to start with threaded libs"[5]  
> by adding this to /usr/local/apache2/bin/envvars:[6]
>   export LD_PRELOAD=/usr/lib/libc_r.so
> But is this the same as compiling Apache with --enable-threads?

No it is not the same. Apache will still be non threaded and only  
prefork MPM
can be used.

> There be dragons, as noted above. Per ld.so(1),[7] LD_PRELOAD  
> denotes "[a] list of shared libraries, separated by colons and/or  
> white space, to be linked in before any other shared libraries."  
> And here my knowledge ends: does linking in the library mean that  
> Apache uses it (acquires threadedness), or just that mod_python  
> does? Does this mean I can use threads from Python?

As above, Apache does not acquire threadedness. Preloading the  
library will
be enough to satisfy unresolved symbols which Python wants. Yes you  
be able to use threads in Python.

I can't understand why this thread problem still persists on FreeBSD  
after all
these years. Why can't they fix it?


More information about the Mod_python mailing list