httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sander Temme <>
Subject Re: Accept locking test code strangeness
Date Wed, 10 Oct 2001 18:30:44 GMT
on 10/10/01 8:38 AM, Jeff Trawick at wrote:

> Justin Erenkrantz <> writes:
>> On Wed, Oct 10, 2001 at 07:38:35AM -0400, Jeff Trawick wrote:
>>> FYI... He's talking about the test-sem program, not Apache.  With
>>> Apache, we don't enable pthread mutexes on Linux (see ap_config.h), so
>>> you can't say "acceptmutex pthread".
>> To quote Sander (now that my email is caught up):
>>> I did get Apache itself    to run with pthread mutex accept locking
>>> without protest or core files.
>> If I'm misunderstanding him, my apologies.  =)
> I doubt that it is a misunderstanding, but either
> 1) he modified Apache 1.3 sources to allow "AcceptMutex pthread" on
>  Linux (a trivial thing to do)

I have been running tests using a Apache 1.3.20 modified by dirkx. His patch
makes the existing accept locking logic accessible at run time and is close
to what Jim Jagielski has been working on. I put the patch online at

So with this patch I *can* tell Apache to

AcceptMethod (http_core.c)
        Serialized AcceptMethod; the methods 'fcntl' 'flock' 'sysvsem'
        'pthread' 'none' are compiled in
        Allowed in *.conf only outside <Directory>, <Files> or <Location>
SingleListen (http_core.c)
        On - to serialize accept and Off  to unserialize accept
        Allowed in *.conf only outside <Directory>, <Files> or <Location>

I have, however, shelved running straight benchmarks on Apache for now as
the tests seem to be limited by other factors than the locking method. This
is why I'm now using time-sem.c to see if I can get some theoretical
indication of what's going on first.

Is it possible that time-sem.c differs from the code actually in Apache
today? Look at src/main/http_main.c, around line 626:

    if ((errno = pthread_mutexattr_setpshared(&mattr,
                                                PTHREAD_PROCESS_SHARED))) {

So we kinda cheat: we help the system by putting the rogue return value in
errno ourselves. (:

Anyway, Justin, thanks for the warning that pthread locking on linux doesn't
actually work. It would have led me astray to no end.


Covalent Technologies                   
Engineering group                                Voice: (415) 536 5214
645 Howard St.                                     Fax: (415) 536 5210
San Francisco CA 94105

   PGP Fingerprint: 1E74 4E58 DFAC 2CF5 6A03  5531 AFB1 96AF B584 0AB1

This email message is for the sole use of the intended recipient(s) and may
contain confidential and privileged information. Any unauthorized review,
use, disclosure or distribution is prohibited.  If you are not the intended
recipient, please contact the sender by reply email and destroy all copies
of the original message

View raw message