httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Bloom <>
Subject Re: Apache/pthread and locking problem
Date Wed, 11 Aug 1999 15:01:58 GMT

This is an issue.  No doubt about it.  I do not believe this was ever
tried in a user-land thread environment.  The easy solution is to remove
the locks like you did for now.  This will cause any system with a
thundering herd problem to go a bit slower, but the code will still work.

Jim, didn't you have this code working on FreeBSD at one point?  Did you
have to do anything special to it?


On Wed, 11 Aug 1999, Ralf S. Engelschall wrote:

> In article <> you wrote:
> > [...]
> > When a connection is established the worker threads start working. When I push
> > in the request to the socket immediately I get the response (for instance via
> > ab or `echo | socket', etc.).  But when I enter the request on the socket
> > manually, the worker thread usually gets a -1 from read() and does a select()
> > until data is actually available. Now comes the problem: While the worker
> > thread is waiting, the thread which does the socket accepts starts over with
> > his loop and does the accept_mutex_on again. And now the whole process stops
> > until a new connection comes in. Until then the whole process is suspended
> > because both flock() and fcntl() based mutexes do suspend the whole process
> > and not just the current thread. At least that's the case for flock and fcntl
> > with both FreeBSD uthread and GNU Pth.
> > [...]
> > Hmmm... either my understanding of the hybrid process model is still not quite
> > correct, or I've overlooked an important part, or I'm right and the stuff
> > cannot work with the standard user-space threading environments :-( Please
> > prove me to be wrong!
> Hmmm... seems like I'm right: When I remove the accept_mutex_on/off calls the
> servers no longer hangs on connections (this was with Apache-mpm-dexter)...
>                                        Ralf S. Engelschall

Ryan Bloom
4205 S Miami Blvd	
RTP, NC 27709		It's a beautiful sight to see good dancers 
			doing simple steps.  It's a painful sight to
			see beginners doing complicated patterns.	

View raw message