httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralf S. Engelschall" <...@engelschall.com>
Subject Re: Apache 2.0 brokenness...
Date Sat, 22 Jan 2000 19:10:33 GMT

In article <3889F2B1.F6EF36F0@algroup.co.uk> you wrote:
> Jim Jagielski wrote:
>> 
>> Ahhh. I've gotten around this by disabling serialized accepts.
>> No idea why but most likely it's a threading conflict.
> 
> Well, of course, if serialised accepts can be disabled, isn't it a good
> idea to do so (module thundering herd problem)?
> 
> I'm slightly bemused, though ... I think it ought to choose pthread
> mutexes instead of fcntl but I don't understand this bit in
> configure.in:
> 
> AC_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl
>             custom:use_pthread_cross,
>             AC_DECIDE(USE_PROC_PTHREAD_SERIALIZE, [pthread mutex]))
> 
> use_pthread_cross is mentioned nowhere else, so I'm not sure what is
> going on, or how it might get set. Can anyone shed any light on it?

My knowledge is not in sync with Apache 2.0's Autoconf stuff, but even
USE_PROC_PTHREAD_SERIALIZE will not help you under FreeBSD, because
pthread_mutexes inside shared memory segments are not supported by
FreeBSD uthread. Additionally, the above Autoconf construct is incorrect
already because of the PTHREAD_PROCESS_SHARED check: It is not allowed
to check whether this exists (every Pthread implementation has to
define it anyway), because it says nothing. What has to checked is the
Pthread feature test macro named _POSIX_THREAD_PROCESS_SHARED! If this
is defined then PTHREAD_PROCESS_SHARED actually works. But it's not the
other way round. 

> Obviously if fcntl() mutexes don't work, as Ralf suggested, they'd
> better not be used! 

They can be used in the prefork MPM, of course. But inside the
multithreaded MPMs using them to implement inter-process mutexes is a
against POSIX and (as the FreeBSD case shows) even doesn't work all the
time in practice. But keep in mind: using fcntl() or flock() in a MT
environment is perfectly legal, of course. The point is just that the
assumption they block only the current thread is not allowed, because
AFAIK POSIX says the semantics of these functions does not change even
under MT environments.
                                       Ralf S. Engelschall
                                       rse@engelschall.com
                                       www.engelschall.com

Mime
View raw message